From 75afb50f2e927bac5184380a0bbc3536c496f34f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 13 Sep 2022 02:57:33 +0000 Subject: [PATCH] CodeGen from PR 20487 in Azure/azure-rest-api-specs Review request for Microsoft.ContainerService to add version 2022-08-02-preview (#20487) * Adds base for updating Microsoft.ContainerService from version preview/2022-07-02-preview to version 2022-08-02-preview * Updates readme * Updates API version in new specs and examples * sync changes from PR#19592 & PR#20145 (#20402) * update readme & remove fleets (#20388) * AKS agent pool properties add AgentPoolWindowsProfile and DisableOutboundNAT (#20407) * AKS agent pool properties add AgentPoolWindowsProfile and DisableOutboundNAT * Change disableOutboundNAT to disableOutboundNat because of ARM format; Improve description. * Improve description * Added guardrails profile to specs (#20171) * added guardrails profile to specs * linter fix * added x-ms-enum * added guardrails definitions for versions route * linter fix, added custom word * fix * typo fix * fix for example * added object type * added object type * removed data field * changed descriptions * * * add "Mariner" for AKS os sku (#20420) * add KubeProxyConfig to AKS NetworkProfile (#20446) * add KubeProxyConfig to AKS NetworkProfile * remove extra comma, type: integer for *Seconds * add custom words * prettier * follow camel case ARM guidance * 2nd camel case standard * feat: add rest api spec for ip-based lb (#20392) * fix LroLocationHeader (#20491) * fix ProvisioningStateValidation (#20490) * Removed guardrailsVersions route, added guardrails profice to MC properties (#20625) * removed guardrails-versions route, added guardrails profice to MC properties * removed unsued file for guardrails versions, removed unused custom word Co-authored-by: Shiqian Tao <62196586+ShiqianTao@users.noreply.github.com> Co-authored-by: rsamigullin <89222124+rsamigullin@users.noreply.github.com> Co-authored-by: Ace Eldeib Co-authored-by: Matt Stam Co-authored-by: Qi Ni --- .../azure-mgmt-containerservice/_meta.json | 6 +- .../azure/mgmt/containerservice/__init__.py | 4 + .../_container_service_client.py | 37 + .../mgmt/containerservice/_serialization.py | 4 +- .../aio/_container_service_client.py | 37 + .../containerservice/v2017_07_01/__init__.py | 3 + .../v2017_07_01/_configuration.py | 4 +- .../containerservice/v2017_07_01/_version.py | 9 + .../v2017_07_01/aio/_configuration.py | 4 +- .../_container_services_operations.py | 43 +- .../_container_services_operations.py | 43 +- .../containerservice/v2018_03_31/__init__.py | 3 + .../v2018_03_31/_configuration.py | 4 +- .../containerservice/v2018_03_31/_version.py | 9 + .../v2018_03_31/aio/_configuration.py | 4 +- .../_managed_clusters_operations.py | 85 +- .../v2018_03_31/aio/operations/_operations.py | 8 +- .../_managed_clusters_operations.py | 85 +- .../v2018_03_31/operations/_operations.py | 8 +- .../v2018_08_01_preview/__init__.py | 3 + .../v2018_08_01_preview/_configuration.py | 4 +- .../v2018_08_01_preview/_version.py | 9 + .../v2018_08_01_preview/aio/_configuration.py | 4 +- .../_managed_clusters_operations.py | 85 +- .../aio/operations/_operations.py | 8 +- .../_managed_clusters_operations.py | 85 +- .../operations/_operations.py | 8 +- .../v2018_09_30_preview/__init__.py | 3 + .../v2018_09_30_preview/_configuration.py | 4 +- .../v2018_09_30_preview/_version.py | 9 + .../v2018_09_30_preview/aio/_configuration.py | 4 +- ..._open_shift_managed_clusters_operations.py | 43 +- ..._open_shift_managed_clusters_operations.py | 43 +- .../containerservice/v2019_02_01/__init__.py | 3 + .../v2019_02_01/_configuration.py | 4 +- .../containerservice/v2019_02_01/_version.py | 9 + .../v2019_02_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 29 +- .../_managed_clusters_operations.py | 85 +- .../v2019_02_01/aio/operations/_operations.py | 8 +- .../operations/_agent_pools_operations.py | 29 +- .../_managed_clusters_operations.py | 85 +- .../v2019_02_01/operations/_operations.py | 8 +- .../containerservice/v2019_04_01/__init__.py | 3 + .../v2019_04_01/_configuration.py | 4 +- .../containerservice/v2019_04_01/_version.py | 9 + .../v2019_04_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 29 +- .../_managed_clusters_operations.py | 85 +- .../v2019_04_01/aio/operations/_operations.py | 8 +- .../operations/_agent_pools_operations.py | 29 +- .../_managed_clusters_operations.py | 85 +- .../v2019_04_01/operations/_operations.py | 8 +- .../containerservice/v2019_04_30/__init__.py | 3 + .../v2019_04_30/_configuration.py | 4 +- .../containerservice/v2019_04_30/_version.py | 9 + .../v2019_04_30/aio/_configuration.py | 4 +- ..._open_shift_managed_clusters_operations.py | 43 +- ..._open_shift_managed_clusters_operations.py | 43 +- .../containerservice/v2019_06_01/__init__.py | 3 + .../v2019_06_01/_configuration.py | 4 +- .../containerservice/v2019_06_01/_version.py | 9 + .../v2019_06_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 85 +- .../v2019_06_01/aio/operations/_operations.py | 8 +- .../operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 85 +- .../v2019_06_01/operations/_operations.py | 8 +- .../containerservice/v2019_08_01/__init__.py | 3 + .../v2019_08_01/_configuration.py | 4 +- .../containerservice/v2019_08_01/_version.py | 9 + .../v2019_08_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 92 +- .../v2019_08_01/aio/operations/_operations.py | 8 +- .../operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 92 +- .../v2019_08_01/operations/_operations.py | 8 +- .../v2019_09_30_preview/__init__.py | 3 + .../v2019_09_30_preview/_configuration.py | 4 +- .../v2019_09_30_preview/_version.py | 9 + .../v2019_09_30_preview/aio/_configuration.py | 4 +- ..._open_shift_managed_clusters_operations.py | 43 +- ..._open_shift_managed_clusters_operations.py | 43 +- .../containerservice/v2019_10_01/__init__.py | 3 + .../v2019_10_01/_configuration.py | 4 +- .../containerservice/v2019_10_01/_version.py | 9 + .../v2019_10_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2019_10_01/aio/operations/_operations.py | 8 +- .../operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2019_10_01/operations/_operations.py | 8 +- .../v2019_10_27_preview/__init__.py | 3 + .../v2019_10_27_preview/_configuration.py | 4 +- .../v2019_10_27_preview/_version.py | 9 + .../v2019_10_27_preview/aio/_configuration.py | 4 +- ..._open_shift_managed_clusters_operations.py | 43 +- ..._open_shift_managed_clusters_operations.py | 43 +- .../containerservice/v2019_11_01/__init__.py | 3 + .../v2019_11_01/_configuration.py | 4 +- .../containerservice/v2019_11_01/_version.py | 9 + .../v2019_11_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2019_11_01/aio/operations/_operations.py | 8 +- .../operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2019_11_01/operations/_operations.py | 8 +- .../containerservice/v2020_01_01/__init__.py | 3 + .../v2020_01_01/_configuration.py | 4 +- .../containerservice/v2020_01_01/_version.py | 9 + .../v2020_01_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2020_01_01/aio/operations/_operations.py | 8 +- .../operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2020_01_01/operations/_operations.py | 8 +- .../containerservice/v2020_02_01/__init__.py | 3 + .../v2020_02_01/_configuration.py | 4 +- .../containerservice/v2020_02_01/_version.py | 9 + .../v2020_02_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2020_02_01/aio/operations/_operations.py | 8 +- .../operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2020_02_01/operations/_operations.py | 8 +- .../containerservice/v2020_03_01/__init__.py | 3 + .../v2020_03_01/_configuration.py | 4 +- .../containerservice/v2020_03_01/_version.py | 9 + .../v2020_03_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2020_03_01/aio/operations/_operations.py | 8 +- .../operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2020_03_01/operations/_operations.py | 8 +- .../containerservice/v2020_04_01/__init__.py | 3 + .../v2020_04_01/_configuration.py | 4 +- .../containerservice/v2020_04_01/_version.py | 9 + .../v2020_04_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2020_04_01/aio/operations/_operations.py | 8 +- .../operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2020_04_01/operations/_operations.py | 8 +- .../containerservice/v2020_06_01/__init__.py | 3 + .../v2020_06_01/_configuration.py | 4 +- .../containerservice/v2020_06_01/_version.py | 9 + .../v2020_06_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2020_06_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../operations/_agent_pools_operations.py | 43 +- .../_managed_clusters_operations.py | 99 +- .../v2020_06_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../containerservice/v2020_07_01/__init__.py | 3 + .../v2020_07_01/_configuration.py | 4 +- .../containerservice/v2020_07_01/_version.py | 9 + .../v2020_07_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_managed_clusters_operations.py | 99 +- .../v2020_07_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../operations/_agent_pools_operations.py | 50 +- .../_managed_clusters_operations.py | 99 +- .../v2020_07_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../containerservice/v2020_09_01/__init__.py | 3 + .../v2020_09_01/_configuration.py | 4 +- .../containerservice/v2020_09_01/_version.py | 9 + .../v2020_09_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_managed_clusters_operations.py | 113 +- .../v2020_09_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_agent_pools_operations.py | 50 +- .../_managed_clusters_operations.py | 113 +- .../v2020_09_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../containerservice/v2020_11_01/__init__.py | 3 + .../v2020_11_01/_configuration.py | 4 +- .../containerservice/v2020_11_01/_version.py | 9 + .../v2020_11_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_managed_clusters_operations.py | 113 +- .../v2020_11_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_agent_pools_operations.py | 50 +- .../_managed_clusters_operations.py | 113 +- .../v2020_11_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../containerservice/v2020_12_01/__init__.py | 3 + .../v2020_12_01/_configuration.py | 4 +- .../containerservice/v2020_12_01/_version.py | 9 + .../v2020_12_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 113 +- .../v2020_12_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 113 +- .../v2020_12_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../containerservice/v2021_02_01/__init__.py | 3 + .../v2021_02_01/_configuration.py | 4 +- .../containerservice/v2021_02_01/_version.py | 9 + .../v2021_02_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 113 +- .../v2021_02_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 113 +- .../v2021_02_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../containerservice/v2021_03_01/__init__.py | 3 + .../v2021_03_01/_configuration.py | 4 +- .../containerservice/v2021_03_01/_version.py | 9 + .../v2021_03_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 134 +- .../v2021_03_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 134 +- .../v2021_03_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../containerservice/v2021_05_01/__init__.py | 3 + .../v2021_05_01/_configuration.py | 4 +- .../containerservice/v2021_05_01/_version.py | 9 + .../v2021_05_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2021_05_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2021_05_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../containerservice/v2021_07_01/__init__.py | 3 + .../v2021_07_01/_configuration.py | 4 +- .../containerservice/v2021_07_01/_version.py | 9 + .../v2021_07_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2021_07_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2021_07_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../containerservice/v2021_08_01/__init__.py | 3 + .../v2021_08_01/_configuration.py | 4 +- .../containerservice/v2021_08_01/_version.py | 9 + .../v2021_08_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2021_08_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2021_08_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../containerservice/v2021_09_01/__init__.py | 3 + .../v2021_09_01/_configuration.py | 4 +- .../containerservice/v2021_09_01/_version.py | 9 + .../v2021_09_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2021_09_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2021_09_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../containerservice/v2021_10_01/__init__.py | 3 + .../v2021_10_01/_configuration.py | 4 +- .../containerservice/v2021_10_01/_version.py | 9 + .../v2021_10_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2021_10_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2021_10_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../v2021_11_01_preview/__init__.py | 3 + .../v2021_11_01_preview/_configuration.py | 4 +- .../v2021_11_01_preview/_version.py | 9 + .../v2021_11_01_preview/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../containerservice/v2022_01_01/__init__.py | 3 + .../v2022_01_01/_configuration.py | 4 +- .../containerservice/v2022_01_01/_version.py | 9 + .../v2022_01_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_01_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_01_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../v2022_01_02_preview/__init__.py | 3 + .../v2022_01_02_preview/_configuration.py | 4 +- .../v2022_01_02_preview/_version.py | 9 + .../v2022_01_02_preview/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../containerservice/v2022_02_01/__init__.py | 3 + .../v2022_02_01/_configuration.py | 4 +- .../containerservice/v2022_02_01/_version.py | 9 + .../v2022_02_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_02_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_02_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../v2022_02_02_preview/__init__.py | 3 + .../v2022_02_02_preview/_configuration.py | 4 +- .../v2022_02_02_preview/_version.py | 9 + .../v2022_02_02_preview/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_cluster_snapshots_operations.py | 43 +- .../_managed_clusters_operations.py | 141 +- .../aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_cluster_snapshots_operations.py | 43 +- .../_managed_clusters_operations.py | 141 +- .../operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../containerservice/v2022_03_01/__init__.py | 3 + .../v2022_03_01/_configuration.py | 4 +- .../containerservice/v2022_03_01/_version.py | 9 + .../v2022_03_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_03_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_03_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../v2022_03_02_preview/__init__.py | 3 + .../v2022_03_02_preview/_configuration.py | 4 +- .../v2022_03_02_preview/_version.py | 9 + .../v2022_03_02_preview/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_cluster_snapshots_operations.py | 43 +- .../_managed_clusters_operations.py | 148 +- .../aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_cluster_snapshots_operations.py | 43 +- .../_managed_clusters_operations.py | 148 +- .../operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../containerservice/v2022_04_01/__init__.py | 3 + .../v2022_04_01/_configuration.py | 4 +- .../containerservice/v2022_04_01/_version.py | 9 + .../v2022_04_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_04_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_04_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../v2022_04_02_preview/__init__.py | 3 + .../v2022_04_02_preview/_configuration.py | 4 +- .../v2022_04_02_preview/_version.py | 9 + .../v2022_04_02_preview/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_cluster_snapshots_operations.py | 43 +- .../_managed_clusters_operations.py | 148 +- .../aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- ...trusted_access_role_bindings_operations.py | 29 +- .../_trusted_access_roles_operations.py | 8 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_cluster_snapshots_operations.py | 43 +- .../_managed_clusters_operations.py | 148 +- .../operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- ...trusted_access_role_bindings_operations.py | 29 +- .../_trusted_access_roles_operations.py | 8 +- .../v2022_05_02_preview/__init__.py | 3 + .../v2022_05_02_preview/_configuration.py | 4 +- .../v2022_05_02_preview/_version.py | 9 + .../v2022_05_02_preview/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_cluster_snapshots_operations.py | 43 +- .../_managed_clusters_operations.py | 148 +- .../aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- ...trusted_access_role_bindings_operations.py | 29 +- .../_trusted_access_roles_operations.py | 8 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_cluster_snapshots_operations.py | 43 +- .../_managed_clusters_operations.py | 148 +- .../operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- ...trusted_access_role_bindings_operations.py | 29 +- .../_trusted_access_roles_operations.py | 8 +- .../containerservice/v2022_06_01/__init__.py | 3 + .../v2022_06_01/_configuration.py | 4 +- .../containerservice/v2022_06_01/_version.py | 9 + .../v2022_06_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_06_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_06_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../v2022_06_02_preview/__init__.py | 3 + .../v2022_06_02_preview/_configuration.py | 4 +- .../v2022_06_02_preview/_version.py | 9 + .../v2022_06_02_preview/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../operations/_fleet_members_operations.py | 29 +- .../aio/operations/_fleets_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_cluster_snapshots_operations.py | 43 +- .../_managed_clusters_operations.py | 148 +- .../aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- ...trusted_access_role_bindings_operations.py | 29 +- .../_trusted_access_roles_operations.py | 8 +- .../operations/_agent_pools_operations.py | 50 +- .../operations/_fleet_members_operations.py | 29 +- .../operations/_fleets_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_cluster_snapshots_operations.py | 43 +- .../_managed_clusters_operations.py | 148 +- .../operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- ...trusted_access_role_bindings_operations.py | 29 +- .../_trusted_access_roles_operations.py | 8 +- .../containerservice/v2022_07_01/__init__.py | 3 + .../v2022_07_01/_configuration.py | 4 +- .../containerservice/v2022_07_01/_version.py | 9 + .../v2022_07_01/aio/_configuration.py | 4 +- .../aio/operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_07_01/aio/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../aio/operations/_snapshots_operations.py | 43 +- .../operations/_agent_pools_operations.py | 50 +- .../_maintenance_configurations_operations.py | 29 +- .../_managed_clusters_operations.py | 141 +- .../v2022_07_01/operations/_operations.py | 8 +- ...private_endpoint_connections_operations.py | 29 +- .../_private_link_resources_operations.py | 8 +- ...olve_private_link_service_id_operations.py | 8 +- .../operations/_snapshots_operations.py | 43 +- .../v2022_07_02_preview/__init__.py | 6 +- .../v2022_07_02_preview/_configuration.py | 41 +- .../_container_service_client.py | 48 +- .../v2022_07_02_preview/_vendor.py | 6 +- .../v2022_07_02_preview/_version.py | 9 + .../v2022_07_02_preview/aio/__init__.py | 3 +- .../v2022_07_02_preview/aio/_configuration.py | 43 +- .../aio/_container_service_client.py | 48 +- .../v2022_07_02_preview/aio/_patch.py | 1 + .../aio/operations/__init__.py | 29 +- .../aio/operations/_agent_pools_operations.py | 379 +- .../operations/_fleet_members_operations.py | 207 +- .../aio/operations/_fleets_operations.py | 310 +- .../_maintenance_configurations_operations.py | 135 +- .../_managed_cluster_snapshots_operations.py | 202 +- .../_managed_clusters_operations.py | 1096 ++- .../aio/operations/_operations.py | 45 +- .../aio/operations/_patch.py | 1 + ...private_endpoint_connections_operations.py | 173 +- .../_private_link_resources_operations.py | 42 +- ...olve_private_link_service_id_operations.py | 41 +- .../aio/operations/_snapshots_operations.py | 210 +- ...trusted_access_role_bindings_operations.py | 135 +- .../_trusted_access_roles_operations.py | 46 +- .../v2022_07_02_preview/models/__init__.py | 343 +- .../models/_container_service_client_enums.py | 132 +- .../v2022_07_02_preview/models/_models_py3.py | 1118 +-- .../v2022_07_02_preview/models/_patch.py | 1 + .../operations/__init__.py | 29 +- .../operations/_agent_pools_operations.py | 716 +- .../operations/_fleet_members_operations.py | 372 +- .../operations/_fleets_operations.py | 553 +- .../_maintenance_configurations_operations.py | 305 +- .../_managed_cluster_snapshots_operations.py | 433 +- .../_managed_clusters_operations.py | 2009 +++-- .../operations/_operations.py | 65 +- .../v2022_07_02_preview/operations/_patch.py | 1 + ...private_endpoint_connections_operations.py | 331 +- .../_private_link_resources_operations.py | 83 +- ...olve_private_link_service_id_operations.py | 86 +- .../operations/_snapshots_operations.py | 437 +- ...trusted_access_role_bindings_operations.py | 293 +- .../_trusted_access_roles_operations.py | 77 +- .../v2022_08_02_preview/__init__.py | 24 + .../v2022_08_02_preview/_configuration.py | 69 + .../_container_service_client.py | 162 + .../v2022_08_02_preview/_metadata.json | 112 + .../v2022_08_02_preview/_patch.py | 20 + .../v2022_08_02_preview/_vendor.py | 27 + .../v2022_08_02_preview/_version.py | 9 + .../v2022_08_02_preview/aio/__init__.py | 21 + .../v2022_08_02_preview/aio/_configuration.py | 66 + .../aio/_container_service_client.py | 159 + .../v2022_08_02_preview/aio/_patch.py | 20 + .../aio/operations/__init__.py | 39 + .../aio/operations/_agent_pools_operations.py | 917 ++ .../_maintenance_configurations_operations.py | 429 + .../_managed_cluster_snapshots_operations.py | 633 ++ .../_managed_clusters_operations.py | 2586 ++++++ .../aio/operations/_operations.py | 127 + .../aio/operations/_patch.py | 20 + ...private_endpoint_connections_operations.py | 461 ++ .../_private_link_resources_operations.py | 115 + ...olve_private_link_service_id_operations.py | 197 + .../aio/operations/_snapshots_operations.py | 621 ++ ...trusted_access_role_bindings_operations.py | 429 + .../_trusted_access_roles_operations.py | 131 + .../v2022_08_02_preview/models/__init__.py | 345 + .../models/_container_service_client_enums.py | 709 ++ .../v2022_08_02_preview/models/_models_py3.py | 7376 +++++++++++++++++ .../v2022_08_02_preview/models/_patch.py | 20 + .../operations/__init__.py | 39 + .../operations/_agent_pools_operations.py | 1245 +++ .../_maintenance_configurations_operations.py | 592 ++ .../_managed_cluster_snapshots_operations.py | 848 ++ .../_managed_clusters_operations.py | 3459 ++++++++ .../operations/_operations.py | 149 + .../v2022_08_02_preview/operations/_patch.py | 20 + ...private_endpoint_connections_operations.py | 643 ++ .../_private_link_resources_operations.py | 158 + ...olve_private_link_service_id_operations.py | 243 + .../operations/_snapshots_operations.py | 834 ++ ...trusted_access_role_bindings_operations.py | 610 ++ .../_trusted_access_roles_operations.py | 162 + .../v2022_08_02_preview/py.typed | 1 + 728 files changed, 46827 insertions(+), 8412 deletions(-) create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_metadata.json create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_vendor.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_version.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/_configuration.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/_container_service_client.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_maintenance_configurations_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_cluster_snapshots_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_resolve_private_link_service_id_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_snapshots_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_role_bindings_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_roles_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_container_service_client_enums.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_models_py3.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/__init__.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_agent_pools_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_maintenance_configurations_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_cluster_snapshots_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_clusters_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_patch.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_link_resources_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_resolve_private_link_service_id_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_snapshots_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_role_bindings_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_roles_operations.py create mode 100644 sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/py.typed diff --git a/sdk/containerservice/azure-mgmt-containerservice/_meta.json b/sdk/containerservice/azure-mgmt-containerservice/_meta.json index 7057dfb45633..94bddfaacc5f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/_meta.json +++ b/sdk/containerservice/azure-mgmt-containerservice/_meta.json @@ -1,11 +1,11 @@ { "autorest": "3.8.4", "use": [ - "@autorest/python@6.0.1", + "@autorest/python@6.1.5", "@autorest/modelerfour@4.23.5" ], - "commit": "eca8060c5746b3b092c50580b59de31fe749d669", + "commit": "eccdca4308df9ea47a9c5f30d6fc2c0cd529c758", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/containerservice/resource-manager/readme.md --models-mode=msrest --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.0.1 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False", + "autorest_command": "autorest specification/containerservice/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.1.5 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False", "readme": "specification/containerservice/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/__init__.py index eb3d7ba7a265..c9e1e010e0e0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/__init__.py @@ -14,3 +14,7 @@ patch_sdk() except ImportError: pass + +from ._version import VERSION + +__version__ = VERSION 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 6b35a749af20..4dc013d454ee 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 @@ -131,6 +131,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2022-06-02-preview: :mod:`v2022_06_02_preview.models` * 2022-07-01: :mod:`v2022_07_01.models` * 2022-07-02-preview: :mod:`v2022_07_02_preview.models` + * 2022-08-02-preview: :mod:`v2022_08_02_preview.models` """ if api_version == '2017-07-01': from .v2017_07_01 import models @@ -261,6 +262,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2022-07-02-preview': from .v2022_07_02_preview import models return models + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -303,6 +307,7 @@ def agent_pools(self): * 2022-06-02-preview: :class:`AgentPoolsOperations` * 2022-07-01: :class:`AgentPoolsOperations` * 2022-07-02-preview: :class:`AgentPoolsOperations` + * 2022-08-02-preview: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -377,6 +382,8 @@ def agent_pools(self): from .v2022_07_01.operations import AgentPoolsOperations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import AgentPoolsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview.operations import AgentPoolsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'agent_pools'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -452,6 +459,7 @@ def maintenance_configurations(self): * 2022-06-02-preview: :class:`MaintenanceConfigurationsOperations` * 2022-07-01: :class:`MaintenanceConfigurationsOperations` * 2022-07-02-preview: :class:`MaintenanceConfigurationsOperations` + * 2022-08-02-preview: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') if api_version == '2020-12-01': @@ -498,6 +506,8 @@ def maintenance_configurations(self): from .v2022_07_01.operations import MaintenanceConfigurationsOperations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview.operations import MaintenanceConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'maintenance_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -512,6 +522,7 @@ def managed_cluster_snapshots(self): * 2022-05-02-preview: :class:`ManagedClusterSnapshotsOperations` * 2022-06-02-preview: :class:`ManagedClusterSnapshotsOperations` * 2022-07-02-preview: :class:`ManagedClusterSnapshotsOperations` + * 2022-08-02-preview: :class:`ManagedClusterSnapshotsOperations` """ api_version = self._get_api_version('managed_cluster_snapshots') if api_version == '2022-02-02-preview': @@ -526,6 +537,8 @@ def managed_cluster_snapshots(self): from .v2022_06_02_preview.operations import ManagedClusterSnapshotsOperations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import ManagedClusterSnapshotsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview.operations import ManagedClusterSnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_cluster_snapshots'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -572,6 +585,7 @@ def managed_clusters(self): * 2022-06-02-preview: :class:`ManagedClustersOperations` * 2022-07-01: :class:`ManagedClustersOperations` * 2022-07-02-preview: :class:`ManagedClustersOperations` + * 2022-08-02-preview: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -650,6 +664,8 @@ def managed_clusters(self): from .v2022_07_01.operations import ManagedClustersOperations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import ManagedClustersOperations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview.operations import ManagedClustersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_clusters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -718,6 +734,7 @@ def operations(self): * 2022-06-02-preview: :class:`Operations` * 2022-07-01: :class:`Operations` * 2022-07-02-preview: :class:`Operations` + * 2022-08-02-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -796,6 +813,8 @@ def operations(self): from .v2022_07_01.operations import Operations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import Operations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -830,6 +849,7 @@ def private_endpoint_connections(self): * 2022-06-02-preview: :class:`PrivateEndpointConnectionsOperations` * 2022-07-01: :class:`PrivateEndpointConnectionsOperations` * 2022-07-02-preview: :class:`PrivateEndpointConnectionsOperations` + * 2022-08-02-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-06-01': @@ -884,6 +904,8 @@ def private_endpoint_connections(self): from .v2022_07_01.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -916,6 +938,7 @@ def private_link_resources(self): * 2022-06-02-preview: :class:`PrivateLinkResourcesOperations` * 2022-07-01: :class:`PrivateLinkResourcesOperations` * 2022-07-02-preview: :class:`PrivateLinkResourcesOperations` + * 2022-08-02-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-09-01': @@ -966,6 +989,8 @@ def private_link_resources(self): from .v2022_07_01.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -998,6 +1023,7 @@ def resolve_private_link_service_id(self): * 2022-06-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` * 2022-07-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2022-07-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` + * 2022-08-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-09-01': @@ -1048,6 +1074,8 @@ def resolve_private_link_service_id(self): from .v2022_07_01.operations import ResolvePrivateLinkServiceIdOperations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_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)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1073,6 +1101,7 @@ def snapshots(self): * 2022-06-02-preview: :class:`SnapshotsOperations` * 2022-07-01: :class:`SnapshotsOperations` * 2022-07-02-preview: :class:`SnapshotsOperations` + * 2022-08-02-preview: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') if api_version == '2021-08-01': @@ -1109,6 +1138,8 @@ def snapshots(self): from .v2022_07_01.operations import SnapshotsOperations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import SnapshotsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview.operations import SnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'snapshots'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1121,6 +1152,7 @@ def trusted_access_role_bindings(self): * 2022-05-02-preview: :class:`TrustedAccessRoleBindingsOperations` * 2022-06-02-preview: :class:`TrustedAccessRoleBindingsOperations` * 2022-07-02-preview: :class:`TrustedAccessRoleBindingsOperations` + * 2022-08-02-preview: :class:`TrustedAccessRoleBindingsOperations` """ api_version = self._get_api_version('trusted_access_role_bindings') if api_version == '2022-04-02-preview': @@ -1131,6 +1163,8 @@ def trusted_access_role_bindings(self): from .v2022_06_02_preview.operations import TrustedAccessRoleBindingsOperations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import TrustedAccessRoleBindingsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview.operations import TrustedAccessRoleBindingsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'trusted_access_role_bindings'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1143,6 +1177,7 @@ def trusted_access_roles(self): * 2022-05-02-preview: :class:`TrustedAccessRolesOperations` * 2022-06-02-preview: :class:`TrustedAccessRolesOperations` * 2022-07-02-preview: :class:`TrustedAccessRolesOperations` + * 2022-08-02-preview: :class:`TrustedAccessRolesOperations` """ api_version = self._get_api_version('trusted_access_roles') if api_version == '2022-04-02-preview': @@ -1153,6 +1188,8 @@ def trusted_access_roles(self): from .v2022_06_02_preview.operations import TrustedAccessRolesOperations as OperationClass elif api_version == '2022-07-02-preview': from .v2022_07_02_preview.operations import TrustedAccessRolesOperations as OperationClass + elif api_version == '2022-08-02-preview': + from .v2022_08_02_preview.operations import TrustedAccessRolesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'trusted_access_roles'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_serialization.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_serialization.py index 2e44d8666b2b..240df16c57f3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_serialization.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_serialization.py @@ -1524,7 +1524,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): try: return self(target_obj, data, content_type=content_type) except: - _LOGGER.warning( + _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -2003,4 +2003,4 @@ def deserialize_unix(attr): msg = "Cannot deserialize to unix datetime object." raise_with_traceback(DeserializationError, msg, err) else: - return date_obj \ No newline at end of file + return date_obj 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 fb4b41f09c68..1af611b2b83f 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 @@ -131,6 +131,7 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2022-06-02-preview: :mod:`v2022_06_02_preview.models` * 2022-07-01: :mod:`v2022_07_01.models` * 2022-07-02-preview: :mod:`v2022_07_02_preview.models` + * 2022-08-02-preview: :mod:`v2022_08_02_preview.models` """ if api_version == '2017-07-01': from ..v2017_07_01 import models @@ -261,6 +262,9 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview import models return models + elif api_version == '2022-08-02-preview': + from ..v2022_08_02_preview import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -303,6 +307,7 @@ def agent_pools(self): * 2022-06-02-preview: :class:`AgentPoolsOperations` * 2022-07-01: :class:`AgentPoolsOperations` * 2022-07-02-preview: :class:`AgentPoolsOperations` + * 2022-08-02-preview: :class:`AgentPoolsOperations` """ api_version = self._get_api_version('agent_pools') if api_version == '2019-02-01': @@ -377,6 +382,8 @@ def agent_pools(self): from ..v2022_07_01.aio.operations import AgentPoolsOperations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import AgentPoolsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_02_preview.aio.operations import AgentPoolsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'agent_pools'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -452,6 +459,7 @@ def maintenance_configurations(self): * 2022-06-02-preview: :class:`MaintenanceConfigurationsOperations` * 2022-07-01: :class:`MaintenanceConfigurationsOperations` * 2022-07-02-preview: :class:`MaintenanceConfigurationsOperations` + * 2022-08-02-preview: :class:`MaintenanceConfigurationsOperations` """ api_version = self._get_api_version('maintenance_configurations') if api_version == '2020-12-01': @@ -498,6 +506,8 @@ def maintenance_configurations(self): from ..v2022_07_01.aio.operations import MaintenanceConfigurationsOperations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import MaintenanceConfigurationsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_02_preview.aio.operations import MaintenanceConfigurationsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'maintenance_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -512,6 +522,7 @@ def managed_cluster_snapshots(self): * 2022-05-02-preview: :class:`ManagedClusterSnapshotsOperations` * 2022-06-02-preview: :class:`ManagedClusterSnapshotsOperations` * 2022-07-02-preview: :class:`ManagedClusterSnapshotsOperations` + * 2022-08-02-preview: :class:`ManagedClusterSnapshotsOperations` """ api_version = self._get_api_version('managed_cluster_snapshots') if api_version == '2022-02-02-preview': @@ -526,6 +537,8 @@ def managed_cluster_snapshots(self): from ..v2022_06_02_preview.aio.operations import ManagedClusterSnapshotsOperations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import ManagedClusterSnapshotsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_02_preview.aio.operations import ManagedClusterSnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_cluster_snapshots'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -572,6 +585,7 @@ def managed_clusters(self): * 2022-06-02-preview: :class:`ManagedClustersOperations` * 2022-07-01: :class:`ManagedClustersOperations` * 2022-07-02-preview: :class:`ManagedClustersOperations` + * 2022-08-02-preview: :class:`ManagedClustersOperations` """ api_version = self._get_api_version('managed_clusters') if api_version == '2018-03-31': @@ -650,6 +664,8 @@ def managed_clusters(self): from ..v2022_07_01.aio.operations import ManagedClustersOperations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import ManagedClustersOperations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_02_preview.aio.operations import ManagedClustersOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'managed_clusters'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -718,6 +734,7 @@ def operations(self): * 2022-06-02-preview: :class:`Operations` * 2022-07-01: :class:`Operations` * 2022-07-02-preview: :class:`Operations` + * 2022-08-02-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2018-03-31': @@ -796,6 +813,8 @@ def operations(self): from ..v2022_07_01.aio.operations import Operations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import Operations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_02_preview.aio.operations import Operations as OperationClass else: raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -830,6 +849,7 @@ def private_endpoint_connections(self): * 2022-06-02-preview: :class:`PrivateEndpointConnectionsOperations` * 2022-07-01: :class:`PrivateEndpointConnectionsOperations` * 2022-07-02-preview: :class:`PrivateEndpointConnectionsOperations` + * 2022-08-02-preview: :class:`PrivateEndpointConnectionsOperations` """ api_version = self._get_api_version('private_endpoint_connections') if api_version == '2020-06-01': @@ -884,6 +904,8 @@ def private_endpoint_connections(self): from ..v2022_07_01.aio.operations import PrivateEndpointConnectionsOperations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_02_preview.aio.operations import PrivateEndpointConnectionsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_endpoint_connections'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -916,6 +938,7 @@ def private_link_resources(self): * 2022-06-02-preview: :class:`PrivateLinkResourcesOperations` * 2022-07-01: :class:`PrivateLinkResourcesOperations` * 2022-07-02-preview: :class:`PrivateLinkResourcesOperations` + * 2022-08-02-preview: :class:`PrivateLinkResourcesOperations` """ api_version = self._get_api_version('private_link_resources') if api_version == '2020-09-01': @@ -966,6 +989,8 @@ def private_link_resources(self): from ..v2022_07_01.aio.operations import PrivateLinkResourcesOperations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_02_preview.aio.operations import PrivateLinkResourcesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'private_link_resources'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -998,6 +1023,7 @@ def resolve_private_link_service_id(self): * 2022-06-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` * 2022-07-01: :class:`ResolvePrivateLinkServiceIdOperations` * 2022-07-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` + * 2022-08-02-preview: :class:`ResolvePrivateLinkServiceIdOperations` """ api_version = self._get_api_version('resolve_private_link_service_id') if api_version == '2020-09-01': @@ -1048,6 +1074,8 @@ def resolve_private_link_service_id(self): from ..v2022_07_01.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import ResolvePrivateLinkServiceIdOperations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_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)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1073,6 +1101,7 @@ def snapshots(self): * 2022-06-02-preview: :class:`SnapshotsOperations` * 2022-07-01: :class:`SnapshotsOperations` * 2022-07-02-preview: :class:`SnapshotsOperations` + * 2022-08-02-preview: :class:`SnapshotsOperations` """ api_version = self._get_api_version('snapshots') if api_version == '2021-08-01': @@ -1109,6 +1138,8 @@ def snapshots(self): from ..v2022_07_01.aio.operations import SnapshotsOperations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import SnapshotsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_02_preview.aio.operations import SnapshotsOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'snapshots'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1121,6 +1152,7 @@ def trusted_access_role_bindings(self): * 2022-05-02-preview: :class:`TrustedAccessRoleBindingsOperations` * 2022-06-02-preview: :class:`TrustedAccessRoleBindingsOperations` * 2022-07-02-preview: :class:`TrustedAccessRoleBindingsOperations` + * 2022-08-02-preview: :class:`TrustedAccessRoleBindingsOperations` """ api_version = self._get_api_version('trusted_access_role_bindings') if api_version == '2022-04-02-preview': @@ -1131,6 +1163,8 @@ def trusted_access_role_bindings(self): from ..v2022_06_02_preview.aio.operations import TrustedAccessRoleBindingsOperations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import TrustedAccessRoleBindingsOperations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_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)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -1143,6 +1177,7 @@ def trusted_access_roles(self): * 2022-05-02-preview: :class:`TrustedAccessRolesOperations` * 2022-06-02-preview: :class:`TrustedAccessRolesOperations` * 2022-07-02-preview: :class:`TrustedAccessRolesOperations` + * 2022-08-02-preview: :class:`TrustedAccessRolesOperations` """ api_version = self._get_api_version('trusted_access_roles') if api_version == '2022-04-02-preview': @@ -1153,6 +1188,8 @@ def trusted_access_roles(self): from ..v2022_06_02_preview.aio.operations import TrustedAccessRolesOperations as OperationClass elif api_version == '2022-07-02-preview': from ..v2022_07_02_preview.aio.operations import TrustedAccessRolesOperations as OperationClass + elif api_version == '2022-08-02-preview': + from ..v2022_08_02_preview.aio.operations import TrustedAccessRolesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'trusted_access_roles'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_configuration.py index 24e995b821b3..6abbedec2127 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/_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/v2017_07_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_configuration.py index 509910f17c0a..73e5b4dd1ee2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 ef94f293cb78..a87350c6bec9 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -80,7 +81,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ContainerService"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerServiceListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -135,7 +141,12 @@ async def _create_or_update_initial( parameters: Union[_models.ContainerService, IO], **kwargs: Any ) -> _models.ContainerService: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -380,7 +391,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2017_07_01.models.ContainerService :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -423,7 +439,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -552,7 +573,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerServiceListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -621,7 +647,12 @@ async def list_orchestrators( :rtype: ~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorVersionProfileListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 d76a0dafe8bb..bf38f8fa366a 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -251,7 +252,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ContainerService"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerServiceListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -306,7 +312,12 @@ def _create_or_update_initial( parameters: Union[_models.ContainerService, IO], **kwargs: Any ) -> _models.ContainerService: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -549,7 +560,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -592,7 +608,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -717,7 +738,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2017-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ContainerServiceListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -786,7 +812,12 @@ def list_orchestrators( :rtype: ~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorVersionProfileListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_configuration.py index 4fc452fe85cd..1d354e5b1b16 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/_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/v2018_03_31/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_configuration.py index 4501222c8a0e..8d3b6db42059 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 e7a26ce18ac9..c297ba498d02 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -86,7 +87,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-03-31")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -161,7 +167,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-03-31")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -232,7 +243,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -292,7 +308,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -350,7 +371,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -407,7 +433,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -462,7 +493,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -505,7 +541,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -723,7 +764,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -932,7 +978,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1038,7 +1089,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1247,7 +1303,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 4bd7a480cbf5..ffc02c929b58 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-03-31")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 b2081ed5550d..194699cd7635 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -438,7 +439,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-03-31")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -511,7 +517,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-03-31")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -582,7 +593,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -642,7 +658,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -700,7 +721,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -757,7 +783,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2018_03_31.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -812,7 +843,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -855,7 +891,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1073,7 +1114,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1282,7 +1328,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1388,7 +1439,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1597,7 +1653,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 07bfeb25de23..bf1fbe4277ca 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-03-31")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py index 55b589213caf..cf694bdafc7b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_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/v2018_08_01_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_configuration.py index fc08dcc9189a..51dcdefbefad 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 79f0c04b1013..325c36f94aeb 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -86,7 +87,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-08-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -161,7 +167,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-08-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -232,7 +243,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -292,7 +308,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -350,7 +371,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -407,7 +433,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -462,7 +493,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -505,7 +541,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -723,7 +764,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -932,7 +978,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1038,7 +1089,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1248,7 +1304,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 a57f2bc9eea9..c03c00126dea 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-08-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 eff142ae8c09..7620d10eeabf 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -444,7 +445,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-08-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -517,7 +523,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-08-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -588,7 +599,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -648,7 +664,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -706,7 +727,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -763,7 +789,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2018_08_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -818,7 +849,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -861,7 +897,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1079,7 +1120,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1288,7 +1334,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1394,7 +1445,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1604,7 +1660,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 123b04c5c464..a2832cbcbd6b 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-08-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_configuration.py index 434fa016fc13..e4b32252d741 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_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/v2018_09_30_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_configuration.py index 8ce1c1668c78..17a7c45e223d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 c804140cdbfc..3ed84772e97c 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -81,7 +82,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftManagedCluster" api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -272,7 +288,12 @@ async def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -496,7 +517,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -707,7 +733,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f9663c1d60da..bec1299e7037 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -258,7 +259,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OpenShiftManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -334,7 +340,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2018-09-30-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -402,7 +413,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -449,7 +465,12 @@ def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -673,7 +694,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -884,7 +910,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_configuration.py index 55a9fdf734f5..86460e775af5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/_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/v2019_02_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_configuration.py index 76304ecc6c3e..0fbe34c9fa46 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_02_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 565035fb5d8d..b1340b9be850 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -436,7 +452,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4fc1400f6da8..f7a39e0964d5 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -86,7 +87,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -161,7 +167,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -232,7 +243,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -292,7 +308,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -350,7 +371,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -407,7 +433,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -462,7 +493,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -505,7 +541,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -723,7 +764,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -932,7 +978,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1038,7 +1089,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1247,7 +1303,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 60835c01add7..2d00f3e61b80 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 eae0cc235b5b..3c9bf9a78baf 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -208,7 +209,12 @@ def list(self, resource_group_name: str, managed_cluster_name: str, **kwargs: An api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -281,7 +287,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -330,7 +341,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -557,7 +573,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b21446872763..c6dbb68a6a3f 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -450,7 +451,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -523,7 +529,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -594,7 +605,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -654,7 +670,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -712,7 +733,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -769,7 +795,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -824,7 +855,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -867,7 +903,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1085,7 +1126,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1294,7 +1340,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1400,7 +1451,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1609,7 +1665,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 2050239fbb19..157103421392 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_configuration.py index 357bcd54b2f1..e9b9c8f9c544 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/_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/v2019_04_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_configuration.py index 0bc3d5366093..99759a247f50 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 3f215daefcc1..708fb2920658 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -82,7 +83,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -155,7 +161,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -204,7 +215,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -434,7 +450,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 102dc148a916..72e2b8aa112c 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -86,7 +87,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -161,7 +167,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -232,7 +243,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -292,7 +308,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -350,7 +371,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -407,7 +433,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -462,7 +493,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -505,7 +541,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -723,7 +764,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -932,7 +978,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1038,7 +1089,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1247,7 +1303,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 f0d2083c42a0..a3baad0f50a9 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 5abf2f2a8c74..bc3fc6b1cd95 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -236,7 +237,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -309,7 +315,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -358,7 +369,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -585,7 +601,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b6bf37c5b645..d57d60ccc66e 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -520,7 +521,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -593,7 +599,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -664,7 +675,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -724,7 +740,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -782,7 +803,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -839,7 +865,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -894,7 +925,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -937,7 +973,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1155,7 +1196,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1364,7 +1410,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1470,7 +1521,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1679,7 +1735,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 a2dabf532b8f..29c77d25a90f 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_configuration.py index 0699b08c493f..81f2d75ba7ba 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/_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/v2019_04_30/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_configuration.py index 5e2b405f643c..8d1f709e3ac7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 dcc19392f2eb..4bffc0656f6f 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -81,7 +82,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftManagedCluster" api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-30")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-30")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -272,7 +288,12 @@ async def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -494,7 +515,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -705,7 +731,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 fa3fb7aa547c..81930288f381 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -258,7 +259,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OpenShiftManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-30")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -334,7 +340,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-04-30")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -402,7 +413,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -449,7 +465,12 @@ def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -671,7 +692,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -882,7 +908,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_configuration.py index 796b8d0d960c..5ccb3e5e1ff3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/_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/v2019_06_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_configuration.py index c44edde0ac29..c40e52d98aee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_06_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 add29ba1e2b5..4ae66bd9cdd6 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -436,7 +452,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -561,7 +582,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -619,7 +645,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 2d29aa7f55c7..ad41a67e058b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -86,7 +87,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -161,7 +167,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -232,7 +243,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -292,7 +308,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -350,7 +371,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -407,7 +433,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -462,7 +493,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -505,7 +541,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -723,7 +764,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -932,7 +978,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1038,7 +1089,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1247,7 +1303,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 5aa802911538..1492ef216f0f 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 bcd7cad9b2c7..e32d45a51ff1 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -313,7 +314,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -386,7 +392,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -435,7 +446,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -662,7 +678,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -787,7 +808,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -845,7 +871,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a7fd159e5f54..1d00e4999858 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -520,7 +521,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -593,7 +599,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -664,7 +675,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -724,7 +740,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -782,7 +803,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -839,7 +865,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -894,7 +925,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -937,7 +973,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1155,7 +1196,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1364,7 +1410,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1470,7 +1521,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1679,7 +1735,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 dbd553f9b54e..5cff323d766e 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_configuration.py index 76cc70d6e097..b2bd577eaa89 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/_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/v2019_08_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_configuration.py index d3a8fed55b7a..6b350c7eddd0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_08_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 47e4b8cdab32..34da1208b998 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -436,7 +452,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -561,7 +582,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -619,7 +645,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 aa4cc63b9161..034169658881 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -87,7 +88,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -162,7 +168,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -233,7 +244,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -293,7 +309,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -351,7 +372,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -408,7 +434,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -463,7 +494,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -506,7 +542,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -724,7 +765,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -933,7 +979,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1039,7 +1090,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1248,7 +1304,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1452,7 +1513,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 53f4f6852aa7..2d7b7c2345b3 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 7bff7d554844..f469e581033a 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -313,7 +314,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -386,7 +392,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -435,7 +446,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -662,7 +678,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -787,7 +808,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -845,7 +871,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 1117df203557..e8fb8bfdfae8 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -558,7 +559,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -631,7 +637,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -702,7 +713,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -762,7 +778,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -820,7 +841,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -877,7 +903,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -932,7 +963,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -975,7 +1011,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1193,7 +1234,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1402,7 +1448,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1508,7 +1559,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1717,7 +1773,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1921,7 +1982,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 dc2d53eb491b..59f3d980a86a 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_configuration.py index e5132584df67..a9d4c5ab8502 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_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/v2019_09_30_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_configuration.py index d656f27be8b3..b4e77f3c30b7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_09_30_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 71584d74a8e0..01bd9deea9ad 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -81,7 +82,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftManagedCluster" api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-30-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-30-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -272,7 +288,12 @@ async def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -496,7 +517,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -707,7 +733,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 57dd92c655af..5f80045996ea 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -258,7 +259,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OpenShiftManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-30-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -334,7 +340,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-09-30-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -402,7 +413,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -449,7 +465,12 @@ def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -673,7 +694,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -884,7 +910,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_configuration.py index 6399c6a6b37c..403bceb569d8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/_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/v2019_10_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_configuration.py index 6e877f3fe23d..ae6995e39ace 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 e111e12496b3..7bd5ba6d3665 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -436,7 +452,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -561,7 +582,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -619,7 +645,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 9837357ae284..55cd3723c203 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -88,7 +89,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -163,7 +169,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -234,7 +245,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -294,7 +310,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -352,7 +373,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -409,7 +435,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -467,7 +498,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -522,7 +558,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +606,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -783,7 +829,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -992,7 +1043,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1098,7 +1154,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1307,7 +1368,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1511,7 +1577,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 dc54b272b300..489af7133c3a 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 dcbbf0653ffe..e6b7237e7e5b 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -313,7 +314,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -386,7 +392,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -435,7 +446,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -662,7 +678,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -787,7 +808,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -845,7 +871,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3e398664cf05..9534f5dc6a84 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -596,7 +597,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -669,7 +675,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -740,7 +751,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -800,7 +816,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -858,7 +879,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -915,7 +941,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -973,7 +1004,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1028,7 +1064,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1071,7 +1112,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1289,7 +1335,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1498,7 +1549,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1604,7 +1660,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1813,7 +1874,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2017,7 +2083,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 61a0cd7dab15..24eef5469868 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py index 567d1c6291f3..13d7c5825222 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_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/v2019_10_27_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_configuration.py index 1907e2c16b93..3ca73134dbcc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_10_27_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 e730b4268b2c..36698ae98a68 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -81,7 +82,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OpenShiftManagedCluster" api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-27-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-27-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -272,7 +288,12 @@ async def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -496,7 +517,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -707,7 +733,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 0c67d002142c..48a63ec14941 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -258,7 +259,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OpenShiftManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-27-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -334,7 +340,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-10-27-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OpenShiftManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -402,7 +413,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -449,7 +465,12 @@ def _create_or_update_initial( parameters: Union[_models.OpenShiftManagedCluster, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -673,7 +694,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.OpenShiftManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -884,7 +910,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_configuration.py index 9570dc95782a..941c2e3bb0da 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/_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/v2019_11_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_configuration.py index 56b12377e0d8..8e3f777f5b86 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_11_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 cf0442e7ea84..59c94b12f8c8 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -436,7 +452,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -561,7 +582,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -619,7 +645,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4c0e72095548..f87e9df2097f 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -88,7 +89,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -163,7 +169,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -234,7 +245,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -294,7 +310,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -352,7 +373,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -409,7 +435,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -467,7 +498,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -522,7 +558,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +606,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -783,7 +829,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -992,7 +1043,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1098,7 +1154,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1307,7 +1368,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1511,7 +1577,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 30ed3deffce5..476fdfd2ff75 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 5b54729dcf53..a26716ff8098 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -313,7 +314,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -386,7 +392,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -435,7 +446,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -662,7 +678,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -787,7 +808,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -845,7 +871,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a2bb9d06f7ed..3ad4c144abaf 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -596,7 +597,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -669,7 +675,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -740,7 +751,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -800,7 +816,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -858,7 +879,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -915,7 +941,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -973,7 +1004,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2019_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1028,7 +1064,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1071,7 +1112,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1289,7 +1335,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1498,7 +1549,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1604,7 +1660,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1813,7 +1874,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2017,7 +2083,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a54a1d4b246b..81709c2f4334 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2019-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_configuration.py index f0539bf3eb3e..04e9003aedb8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/_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/v2020_01_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_configuration.py index 9f0f1b9ae264..fb75a587922c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_01_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 f3d54051c4e5..d0861f02a6b1 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -436,7 +452,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -561,7 +582,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -619,7 +645,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 0ed00a0cfc02..97d9972350c4 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -88,7 +89,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -163,7 +169,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -234,7 +245,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -294,7 +310,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -352,7 +373,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -409,7 +435,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -467,7 +498,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -522,7 +558,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +606,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -783,7 +829,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -992,7 +1043,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1098,7 +1154,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1307,7 +1368,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1511,7 +1577,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 67cc938bd358..4f0ed4820eea 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 aec58265fe0a..bf32aca0fdf0 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -313,7 +314,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -386,7 +392,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -435,7 +446,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -662,7 +678,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -787,7 +808,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -845,7 +871,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b2a0d9394158..9ab2b60b5103 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -596,7 +597,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -669,7 +675,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -740,7 +751,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -800,7 +816,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -858,7 +879,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -915,7 +941,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -973,7 +1004,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1028,7 +1064,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1071,7 +1112,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1289,7 +1335,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1498,7 +1549,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1604,7 +1660,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1813,7 +1874,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2017,7 +2083,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 11ac5b52b57f..5fe28b279517 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_configuration.py index fbfb956ecef0..ab98bb004426 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/_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/v2020_02_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_configuration.py index d1c4af7689e0..56a1f2d9646e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_02_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 b4758a1ea7ad..d149bcd276d3 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -436,7 +452,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -561,7 +582,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -619,7 +645,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 68346523fcda..31668058b7e3 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -88,7 +89,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -163,7 +169,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -234,7 +245,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -294,7 +310,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -352,7 +373,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -409,7 +435,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -467,7 +498,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -522,7 +558,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +606,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -783,7 +829,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -992,7 +1043,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1098,7 +1154,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1307,7 +1368,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1511,7 +1577,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c42c0d333b03..8767749a064c 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 58951f86bc1a..3c52f0d223d1 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -313,7 +314,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -386,7 +392,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -435,7 +446,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -662,7 +678,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -787,7 +808,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -845,7 +871,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 452ddf6d7a54..bd7590153052 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -596,7 +597,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -669,7 +675,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -740,7 +751,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -800,7 +816,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -858,7 +879,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -915,7 +941,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -973,7 +1004,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1028,7 +1064,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1071,7 +1112,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1289,7 +1335,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1498,7 +1549,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1604,7 +1660,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1813,7 +1874,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2017,7 +2083,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 8fea3a448f94..e13e4cbd795e 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_configuration.py index 00f921ef7d62..8c69cf52d799 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/_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/v2020_03_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_configuration.py index ed42ed2be309..f5ba48e75f23 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_03_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 7342f3eca497..fd32a984db34 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -436,7 +452,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -561,7 +582,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -619,7 +645,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 fffdc6f406f2..7f89b0e2f2dc 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -88,7 +89,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -163,7 +169,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -234,7 +245,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -294,7 +310,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -352,7 +373,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -409,7 +435,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -467,7 +498,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -522,7 +558,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +606,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -783,7 +829,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -992,7 +1043,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1098,7 +1154,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1307,7 +1368,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1511,7 +1577,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3ffed01935bf..5e51e00d4393 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 354d12e1dc33..f9b5cedea3cf 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -313,7 +314,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -386,7 +392,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -435,7 +446,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -662,7 +678,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -787,7 +808,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -845,7 +871,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b0817af1e5fd..ca65c5729431 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -596,7 +597,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -669,7 +675,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -740,7 +751,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -800,7 +816,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -858,7 +879,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -915,7 +941,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -973,7 +1004,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1028,7 +1064,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1071,7 +1112,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1289,7 +1335,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1498,7 +1549,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1604,7 +1660,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1813,7 +1874,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2017,7 +2083,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 8a55fac292ab..69b6b29a685a 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_configuration.py index d342e9e6b044..7694b1966be1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/_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/v2020_04_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_configuration.py index a456a32f574f..933345bd2341 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_04_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 1a6fdde7378f..776e079c5423 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -436,7 +452,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -561,7 +582,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -619,7 +645,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 16fb1873784e..9f65df24981c 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -88,7 +89,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -163,7 +169,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -234,7 +245,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -298,7 +314,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -356,7 +377,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -413,7 +439,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -471,7 +502,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -526,7 +562,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -569,7 +610,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -787,7 +833,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -996,7 +1047,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1102,7 +1158,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1311,7 +1372,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1515,7 +1581,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 d6e33a35c2a3..1fdfa96cf95f 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 e9efff27aaa8..3a69f4d46353 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -313,7 +314,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -386,7 +392,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -435,7 +446,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -662,7 +678,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -787,7 +808,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -845,7 +871,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 14e22f1f6a69..b22123002ae5 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -596,7 +597,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -669,7 +675,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -740,7 +751,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -804,7 +820,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -862,7 +883,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -919,7 +945,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -977,7 +1008,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1032,7 +1068,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1075,7 +1116,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1293,7 +1339,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1502,7 +1553,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1608,7 +1664,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1817,7 +1878,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2021,7 +2087,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 0f3bd119bb59..3c9cb89d6d04 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_configuration.py index 87e74ececadd..d8517a08872e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/_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/v2020_06_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_configuration.py index 303aa9b324c3..2ffa02eb1a2d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_06_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 1f9826a1db3d..dc9b884db2bb 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -436,7 +452,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -561,7 +582,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -619,7 +645,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ce2a359ad065..88e328a548d1 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -88,7 +89,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -163,7 +169,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -234,7 +245,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -298,7 +314,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -356,7 +377,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -413,7 +439,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -471,7 +502,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -526,7 +562,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -569,7 +610,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -787,7 +833,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -996,7 +1047,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1102,7 +1158,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1311,7 +1372,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1515,7 +1581,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f2436882250f..b0eb2812e376 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 989064d18d57..45f2d2ce2cf6 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -133,7 +139,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -271,7 +282,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -327,7 +343,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c000b52ae74e..4fa3ecdb2fc9 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -313,7 +314,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -386,7 +392,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -435,7 +446,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -662,7 +678,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -787,7 +808,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -845,7 +871,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 dc52c87e9f19..4a18375a7469 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -596,7 +597,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -669,7 +675,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -740,7 +751,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -804,7 +820,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -862,7 +883,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -919,7 +945,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -977,7 +1008,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1032,7 +1068,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1075,7 +1116,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1293,7 +1339,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1502,7 +1553,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1608,7 +1664,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1817,7 +1878,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2021,7 +2087,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f0da068131f4..8efcc1b72c94 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 9b7417067af5..01bbd6a1cb29 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -307,7 +313,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -445,7 +456,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2020_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -501,7 +517,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_configuration.py index e8b6063d7379..376c638ea9f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/_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/v2020_07_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_configuration.py index ea3193a0c6b7..fb5fb48d0e22 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 97a0a3557913..16cb580e9195 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -158,7 +164,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -207,7 +218,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -437,7 +453,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -562,7 +583,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -620,7 +646,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -663,7 +694,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a22f01dbccef..3c4649005b22 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -88,7 +89,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -163,7 +169,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -234,7 +245,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -298,7 +314,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -356,7 +377,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -413,7 +439,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -471,7 +502,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -526,7 +562,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -569,7 +610,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -787,7 +833,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -996,7 +1047,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1102,7 +1158,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1311,7 +1372,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1515,7 +1581,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 73fdd10e4635..a5a86b338fc6 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 4d39527f84e2..b56c14927954 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -133,7 +139,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -271,7 +282,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -327,7 +343,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 046bf324a848..ccc51e6c3d77 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -352,7 +353,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -425,7 +431,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -474,7 +485,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -701,7 +717,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -826,7 +847,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -884,7 +910,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -927,7 +958,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 84550dd64a6b..4976fb0ac73f 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -596,7 +597,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -669,7 +675,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -740,7 +751,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -804,7 +820,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -862,7 +883,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -919,7 +945,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -977,7 +1008,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1032,7 +1068,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1075,7 +1116,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1293,7 +1339,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1502,7 +1553,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1608,7 +1664,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1817,7 +1878,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2021,7 +2087,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 bb7a9304a193..d41908369271 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 07df300b322b..2aa791c3efea 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -307,7 +313,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -445,7 +456,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2020_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -501,7 +517,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_configuration.py index 8c7bbb8538af..0bdae9f13a23 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/_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/v2020_09_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_configuration.py index c506a0562d1b..3a257cebf6bd 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 874b5a828dad..d55f976941e4 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -158,7 +164,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -207,7 +218,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -437,7 +453,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -562,7 +583,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -620,7 +646,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -663,7 +694,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 6724e49f1f9f..644919f21a31 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -90,7 +91,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -165,7 +171,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -236,7 +247,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -300,7 +316,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -358,7 +379,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -415,7 +441,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -473,7 +504,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -528,7 +564,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -571,7 +612,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -789,7 +835,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -998,7 +1049,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1104,7 +1160,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1313,7 +1374,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1517,7 +1583,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1621,7 +1692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1723,7 +1799,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 7dd80f14ba46..d9a0895259af 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 eef1fc2a07be..87b2440525b8 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -133,7 +139,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -271,7 +282,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -327,7 +343,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 9476386405e2..f199766c679a 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3d5d7fe9f480..f585aa425721 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -136,7 +137,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 ca408ec87598..be3417a4c7f8 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -352,7 +353,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -425,7 +431,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -474,7 +485,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -701,7 +717,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -826,7 +847,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -884,7 +910,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -927,7 +958,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a2aab5ad864d..8226bbe78639 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -672,7 +673,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -745,7 +751,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -816,7 +827,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -880,7 +896,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -938,7 +959,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -995,7 +1021,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1053,7 +1084,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1108,7 +1144,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1151,7 +1192,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1369,7 +1415,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1578,7 +1629,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1684,7 +1740,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1893,7 +1954,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2097,7 +2163,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2201,7 +2272,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2303,7 +2379,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 faad11f5b798..fef35853155f 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 d2500ab3d970..8b8a20c1064e 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -307,7 +313,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -445,7 +456,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -501,7 +517,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a397500db9bf..740716328e27 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f4766ab95f56..abdc07048a31 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -180,7 +181,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2020_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_configuration.py index 39a6e62e6725..070854f367fc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/_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/v2020_11_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_configuration.py index 356f752ac699..e69c5057bd32 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_11_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 af39e954ae30..87452ec14966 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -158,7 +164,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -207,7 +218,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -437,7 +453,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -562,7 +583,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -620,7 +646,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -663,7 +694,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 25599988c37b..1e78c4cdf142 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -90,7 +91,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -165,7 +171,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -236,7 +247,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -300,7 +316,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -358,7 +379,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -415,7 +441,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -473,7 +504,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -528,7 +564,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -571,7 +612,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -789,7 +835,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -998,7 +1049,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1104,7 +1160,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1313,7 +1374,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1517,7 +1583,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1621,7 +1692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1723,7 +1799,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 2f147875e3bd..9275980c15cd 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 18f549161ad0..f9b6a315052a 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -133,7 +139,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -271,7 +282,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -327,7 +343,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 27482bf45351..d4e64b275fa2 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4bbd0777aa18..b9579f18086b 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -136,7 +137,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 c3f85c5631d9..b48647edf6f8 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -352,7 +353,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -425,7 +431,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -474,7 +485,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -701,7 +717,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -826,7 +847,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -884,7 +910,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -927,7 +958,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a3c00bf17e37..17e50b0b9b35 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -672,7 +673,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -745,7 +751,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -816,7 +827,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -880,7 +896,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -938,7 +959,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -995,7 +1021,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1053,7 +1084,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1108,7 +1144,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1151,7 +1192,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1369,7 +1415,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1578,7 +1629,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1684,7 +1740,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1893,7 +1954,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2097,7 +2163,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2201,7 +2272,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2303,7 +2379,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 fae5cbe6c180..3efc70fcf3ce 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 cb027b3f9aad..9257064d00a2 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -307,7 +313,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -445,7 +456,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -501,7 +517,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 37e2d8e45e9c..7d3491ccd8fd 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3becbef0788c..f04c96abd3d7 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -180,7 +181,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2020_11_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_configuration.py index 07fcacb82b31..9f6ddb83e11a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/_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/v2020_12_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_configuration.py index 265db4a3a11e..511084ca3657 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_12_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 97e3bc201120..5933b70e916b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -158,7 +164,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -207,7 +218,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -437,7 +453,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -562,7 +583,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -620,7 +646,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -663,7 +694,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ed6271eca0df..d85ec052333d 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -156,7 +162,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -294,7 +305,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -366,7 +382,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4b3856298d32..6596f5e81bc3 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -90,7 +91,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -165,7 +171,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -236,7 +247,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -300,7 +316,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -358,7 +379,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -415,7 +441,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -473,7 +504,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -528,7 +564,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -571,7 +612,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -789,7 +835,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -998,7 +1049,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1104,7 +1160,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1313,7 +1374,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1517,7 +1583,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1621,7 +1692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1723,7 +1799,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3d1cdb9c4e6d..84e5a1f9fbb9 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 c0f0bd6215e4..fdd2336ead4e 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -133,7 +139,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -271,7 +282,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -327,7 +343,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 cbeb3d58e89c..c03430f743fd 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 809fdad856d6..cdc6e57306b7 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -136,7 +137,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 f0bc5d05c06b..0776515a85db 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -352,7 +353,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -425,7 +431,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -474,7 +485,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -701,7 +717,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -826,7 +847,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -884,7 +910,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -927,7 +958,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 e592bfd39e7a..3220610f8edd 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -238,7 +239,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -311,7 +317,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -449,7 +460,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -521,7 +537,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3db2cbf4a49f..311ac037cc45 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -672,7 +673,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -745,7 +751,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -816,7 +827,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -880,7 +896,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -938,7 +959,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -995,7 +1021,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1053,7 +1084,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1108,7 +1144,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1151,7 +1192,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1369,7 +1415,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1578,7 +1629,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1684,7 +1740,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1893,7 +1954,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2097,7 +2163,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2201,7 +2272,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2303,7 +2379,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a3e383c1ba7c..ddaa4cb4dba2 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2020-12-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 5886486f78dc..8d589b5de3b9 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -307,7 +313,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -445,7 +456,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -501,7 +517,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 cb35044e3435..3d029bb1e2e1 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ee9985b0dc1a..d2d34a3fc1be 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -180,7 +181,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2020_12_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_configuration.py index 0713db3c9713..7af991a71f9a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/_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/v2021_02_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_configuration.py index 198f59f7a18f..ea319e67a50c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_02_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 f40eb03dd826..b874890228e4 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -158,7 +164,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -207,7 +218,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -437,7 +453,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -562,7 +583,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -620,7 +646,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -663,7 +694,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 8a1816b1f095..a6d3982b9c79 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -156,7 +162,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -294,7 +305,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -366,7 +382,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f3e1b2167023..4c7e2fc2b856 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -90,7 +91,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -165,7 +171,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -236,7 +247,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -300,7 +316,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -358,7 +379,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -415,7 +441,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -473,7 +504,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -528,7 +564,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -571,7 +612,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -789,7 +835,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -998,7 +1049,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1104,7 +1160,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1313,7 +1374,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1517,7 +1583,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1621,7 +1692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1723,7 +1799,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ae547d693fd7..a327500081d9 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 4d6b88da8c49..b27ed8fbb70b 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -133,7 +139,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -271,7 +282,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -327,7 +343,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 bb77f517b637..0f8955a0d4f0 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 447846592f84..e0523ed07380 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -136,7 +137,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 75104479e6b1..46dacc5b96f1 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -352,7 +353,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -425,7 +431,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -474,7 +485,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -701,7 +717,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -826,7 +847,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -884,7 +910,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -927,7 +958,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c749ecd77009..5b70bd9eb849 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -238,7 +239,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -311,7 +317,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -449,7 +460,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -521,7 +537,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 69a52df4a524..ff4d62fbdc37 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -672,7 +673,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -745,7 +751,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -816,7 +827,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -880,7 +896,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -938,7 +959,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -995,7 +1021,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1053,7 +1084,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1108,7 +1144,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1151,7 +1192,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1369,7 +1415,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1578,7 +1629,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1684,7 +1740,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1893,7 +1954,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2097,7 +2163,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2201,7 +2272,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2303,7 +2379,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 50d6e9b469f7..a751c3cd937d 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 d1d8585a795c..b046d498a30a 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -307,7 +313,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -445,7 +456,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -501,7 +517,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 86bedfeae09e..c2b352221e8d 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 68f237d7fc5e..a8be34213282 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -180,7 +181,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_configuration.py index 94f16641fee6..14f7a1d8cb8c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/_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/v2021_03_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_configuration.py index 1f429d6578c0..90ef46d34121 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_03_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 8706fc27e7ec..9e691ed7a35b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -158,7 +164,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -207,7 +218,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -437,7 +453,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -562,7 +583,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -620,7 +646,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -663,7 +694,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5980e70f30cb..4c98877a58a0 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -156,7 +162,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -294,7 +305,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -366,7 +382,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a84584791ca0..8bf48714da49 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -92,7 +93,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -226,7 +237,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -297,7 +313,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -361,7 +382,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -419,7 +445,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -476,7 +507,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -534,7 +570,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -589,7 +630,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -632,7 +678,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -850,7 +901,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1059,7 +1115,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1165,7 +1226,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1374,7 +1440,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1578,7 +1649,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1682,7 +1758,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1784,7 +1865,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1890,7 +1976,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2124,7 +2215,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5941abd5a6bd..9652fce008b3 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 1f83730a91dc..eb81ca5ae354 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -133,7 +139,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -271,7 +282,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -327,7 +343,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 30c0b6b6a9be..c8d599151220 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ab2f33a7733a..ebfdea7d70c5 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -136,7 +137,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 dee74f4db21c..773f940b81ea 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -352,7 +353,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -425,7 +431,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -474,7 +485,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -701,7 +717,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -826,7 +847,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -884,7 +910,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -927,7 +958,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4579bfe10cb0..1186301203e2 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -238,7 +239,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -311,7 +317,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -449,7 +460,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -521,7 +537,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 cc05fa6b76a1..8050df8f88a6 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -783,7 +784,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -842,7 +848,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -915,7 +926,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -986,7 +1002,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1050,7 +1071,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1108,7 +1134,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1165,7 +1196,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1223,7 +1259,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1278,7 +1319,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1321,7 +1367,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1539,7 +1590,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1748,7 +1804,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1854,7 +1915,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2063,7 +2129,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2267,7 +2338,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2371,7 +2447,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2473,7 +2554,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2579,7 +2665,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2813,7 +2904,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 38b788ee073c..d3d8e0d4fc42 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -89,7 +90,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 0eef696e2fd3..e3e496e699b1 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -307,7 +313,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -445,7 +456,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -501,7 +517,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f36cad3e28b4..f3cefa083661 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 e93a68bb5208..ce41df5c0a63 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -180,7 +181,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_configuration.py index 9574e18da22b..57eb55caa966 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/_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/v2021_05_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_configuration.py index 49305882499e..e8c6e0589447 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_05_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 eb4aa10f65b1..8576bf542ebe 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -434,7 +450,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -558,7 +579,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -618,7 +644,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -661,7 +692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3ffdd1af5656..64b76f65567b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -82,7 +83,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -155,7 +161,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -291,7 +302,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -363,7 +379,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 83d2d692a08c..5b24c08ef42f 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -295,7 +311,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -357,7 +378,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -417,7 +443,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -477,7 +508,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -537,7 +573,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -593,7 +634,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -636,7 +682,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -849,7 +900,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1058,7 +1114,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1225,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1371,7 +1437,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1573,7 +1644,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1678,7 +1754,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1784,7 +1865,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1891,7 +1977,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2127,7 +2218,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2197,7 +2293,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 e4a1c612d52e..d0820f05bffa 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 c5f2b4570c4c..1ad5cb95cc07 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -134,7 +140,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -270,7 +281,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -326,7 +342,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b41ec0171a9d..6f42908669b6 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b6115d08758a..4eb49dda6e3a 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -134,7 +135,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 d6532caec481..49e0d96c2930 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -351,7 +352,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -424,7 +430,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -473,7 +484,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -698,7 +714,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -822,7 +843,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -882,7 +908,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -925,7 +956,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 39e1c95c9cad..7cbe491d4541 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -237,7 +238,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -310,7 +316,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -446,7 +457,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -518,7 +534,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 62ec7b325211..67dc4e290598 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -842,7 +843,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -900,7 +906,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -972,7 +983,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1042,7 +1058,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1104,7 +1125,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1190,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1224,7 +1255,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1284,7 +1320,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1381,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1383,7 +1429,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1596,7 +1647,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1805,7 +1861,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1911,7 +1972,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2118,7 +2184,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2320,7 +2391,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2425,7 +2501,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2531,7 +2612,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2638,7 +2724,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2874,7 +2965,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2944,7 +3040,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 35dd8f677a04..1846e7c4ff39 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 0bde80de9aa0..93c097f04992 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -308,7 +314,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -444,7 +455,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -500,7 +516,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 457af93da353..789c7cac5af1 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 fd619ff28e66..7de23287aff6 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -178,7 +179,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_05_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_configuration.py index 9b7940e42173..968846f3bf43 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/_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/v2021_07_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_configuration.py index 967b7c663e1a..937ba2cf08b2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_07_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 6387563b9201..7f620ccce4cd 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -434,7 +450,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -558,7 +579,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -618,7 +644,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -661,7 +692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 6a07282d7a43..bc3e18a6c4c7 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -82,7 +83,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -155,7 +161,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -291,7 +302,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -363,7 +379,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3fdf8e6a6783..7a25588cd594 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -295,7 +311,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -357,7 +378,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -417,7 +443,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -477,7 +508,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -537,7 +573,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -593,7 +634,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -636,7 +682,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -849,7 +900,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1058,7 +1114,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1225,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1371,7 +1437,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1573,7 +1644,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1678,7 +1754,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1784,7 +1865,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1891,7 +1977,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2127,7 +2218,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2197,7 +2293,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 d133805886f3..6952353db043 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 7cbe6f37ce51..4b4507a158af 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -134,7 +140,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -270,7 +281,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -326,7 +342,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 bdc941b273a5..93c005b4876f 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ab55d258bfe3..c5b6cc4b7f10 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -134,7 +135,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 ecfaa118f174..057bf584387a 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -351,7 +352,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -424,7 +430,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -473,7 +484,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -698,7 +714,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -822,7 +843,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -882,7 +908,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -925,7 +956,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 23e898f61688..c32a585bdfa8 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -237,7 +238,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -310,7 +316,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -446,7 +457,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -518,7 +534,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 aa071dca6fb9..bdbec1f83cfe 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -842,7 +843,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -900,7 +906,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -972,7 +983,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1042,7 +1058,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1104,7 +1125,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1190,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1224,7 +1255,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1284,7 +1320,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1381,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1383,7 +1429,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1596,7 +1647,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1805,7 +1861,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1911,7 +1972,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2118,7 +2184,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2320,7 +2391,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2425,7 +2501,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2531,7 +2612,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2638,7 +2724,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2874,7 +2965,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2944,7 +3040,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 0e78a2e5279f..45f89b351221 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 8063a9404041..66a707845f12 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -308,7 +314,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -444,7 +455,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -500,7 +516,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4fdf16271b63..20d5b0decfb1 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 277a0589b6a2..9de9cd5d848c 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -178,7 +179,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_07_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py index d03e63926d9a..a1a7de8c0c94 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/_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/v2021_08_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py index 85db2dab5346..9c45b16cdeec 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_08_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 e2947173879d..25fd004462df 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -434,7 +450,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -558,7 +579,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -618,7 +644,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -661,7 +692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 7136618193d7..110aa57e6cb5 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -82,7 +83,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -155,7 +161,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -291,7 +302,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -363,7 +379,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 35556e540dcb..aca393a331b5 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -295,7 +311,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -357,7 +378,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -417,7 +443,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -477,7 +508,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -537,7 +573,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -593,7 +634,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -636,7 +682,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -849,7 +900,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1058,7 +1114,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1225,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1371,7 +1437,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1573,7 +1644,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1678,7 +1754,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1784,7 +1865,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1891,7 +1977,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2127,7 +2218,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2197,7 +2293,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 afd38f10a5cd..eaf98c224d3b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 cc704bfcaed3..20b7221b69d5 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -134,7 +140,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -270,7 +281,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -326,7 +342,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 75e5c6b2552e..7191dc171c6d 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5501bae3e682..d64e26aaefcb 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -134,7 +135,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 5420b68e668b..0809cb1f86ec 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -149,7 +155,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -217,7 +228,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -338,7 +354,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -475,7 +496,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -544,7 +570,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 683ce9c6cd80..f3fe87af556c 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -351,7 +352,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -424,7 +430,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -473,7 +484,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -698,7 +714,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -822,7 +843,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -882,7 +908,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -925,7 +956,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 56a77c168927..50c7dc31b040 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -237,7 +238,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -310,7 +316,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -446,7 +457,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -518,7 +534,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c7af6f715abc..406d842ef082 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -842,7 +843,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -900,7 +906,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -972,7 +983,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1042,7 +1058,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1104,7 +1125,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1190,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1224,7 +1255,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1284,7 +1320,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1381,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1383,7 +1429,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1596,7 +1647,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1805,7 +1861,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1911,7 +1972,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2118,7 +2184,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2320,7 +2391,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2425,7 +2501,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2531,7 +2612,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2638,7 +2724,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2874,7 +2965,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2944,7 +3040,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 ea2e1ed036af..5f8331355271 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 7a1d52b9b840..03c6b7bdad17 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -308,7 +314,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -444,7 +455,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -500,7 +516,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4914c2ac36d4..794047ff21f7 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 9b106dafe2b7..fe2744de9bd0 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -178,7 +179,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 5542ecab3886..dad9187a49e0 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -279,7 +280,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -350,7 +356,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-08-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -418,7 +429,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -539,7 +555,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -676,7 +697,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_08_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -745,7 +771,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_configuration.py index ac6d2d3bda88..09e690191148 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/_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/v2021_09_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_configuration.py index c7d1d81e8142..3e56a5291117 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_09_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 3be311b94cfa..0278cd83fe18 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -434,7 +450,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -558,7 +579,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -618,7 +644,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -661,7 +692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 df1d1491a5df..7755de185a14 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -82,7 +83,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -155,7 +161,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -291,7 +302,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -363,7 +379,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 d2af69e5b227..b02238bf4733 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -295,7 +311,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -357,7 +378,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -417,7 +443,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -477,7 +508,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -537,7 +573,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -593,7 +634,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -636,7 +682,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -849,7 +900,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1058,7 +1114,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1225,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1371,7 +1437,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1573,7 +1644,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1678,7 +1754,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1784,7 +1865,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1891,7 +1977,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2127,7 +2218,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2197,7 +2293,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 46ecb6e0a529..dfeab05e1bb1 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 5c918b3494ea..afc50fbbe4ec 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -134,7 +140,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -270,7 +281,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -326,7 +342,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3be90c8c874b..73eeead6eed9 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 7bb3cef2987e..93f2793e533b 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -134,7 +135,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 047b47b9c56f..f7a784932a59 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -149,7 +155,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -217,7 +228,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -338,7 +354,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -475,7 +496,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -544,7 +570,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4673754c55d6..8701687c1a69 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -351,7 +352,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -424,7 +430,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -473,7 +484,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -698,7 +714,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -822,7 +843,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -882,7 +908,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -925,7 +956,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f3693272eb18..e703dd727958 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -237,7 +238,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -310,7 +316,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -446,7 +457,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -518,7 +534,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 97841588c337..e7b34bfa4256 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -842,7 +843,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -900,7 +906,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -972,7 +983,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1042,7 +1058,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1104,7 +1125,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1190,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1224,7 +1255,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1284,7 +1320,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1381,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1383,7 +1429,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1596,7 +1647,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1805,7 +1861,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1911,7 +1972,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2118,7 +2184,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2320,7 +2391,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2425,7 +2501,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2531,7 +2612,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2638,7 +2724,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2874,7 +2965,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2944,7 +3040,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 7912aa081eef..ef5376d757c9 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 edbdcdfacf0a..2598903b82e2 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -308,7 +314,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -444,7 +455,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -500,7 +516,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 99270d780030..c29c7c5eece6 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 2967586ec710..41ed7cbaaf59 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -178,7 +179,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 78b773ffc9ea..522a22701450 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -279,7 +280,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -350,7 +356,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-09-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -418,7 +429,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -539,7 +555,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -676,7 +697,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_09_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -745,7 +771,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_configuration.py index c32010a30727..d3d582cc87b8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/_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/v2021_10_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_configuration.py index aad1fdb0f391..a461b824b8b6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_10_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 90b19b103232..9a2fd4bb4690 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -434,7 +450,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -558,7 +579,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -618,7 +644,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -661,7 +692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 e489bcce69c7..3b865b5d8fc0 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -82,7 +83,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -155,7 +161,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -291,7 +302,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -363,7 +379,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 1ffa6e4644b1..4bab290c7907 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -295,7 +311,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -357,7 +378,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -417,7 +443,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -477,7 +508,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -537,7 +573,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -593,7 +634,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -636,7 +682,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -849,7 +900,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1058,7 +1114,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1225,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1371,7 +1437,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1573,7 +1644,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1678,7 +1754,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1784,7 +1865,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1891,7 +1977,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2127,7 +2218,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2197,7 +2293,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 584b2bd6bde8..7d1504e9a330 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 4450caa77b64..670ddaf98e63 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -134,7 +140,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -270,7 +281,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -326,7 +342,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4d1937410933..7e7834dd547a 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ebd87464c93b..f1e49cba6bea 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -134,7 +135,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 d8b651d1669e..c454cd8839f8 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -149,7 +155,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -217,7 +228,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -338,7 +354,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -475,7 +496,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -544,7 +570,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 8ef2e27c98d4..3b9277ae98d5 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -351,7 +352,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -424,7 +430,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -473,7 +484,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -698,7 +714,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -822,7 +843,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -882,7 +908,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -925,7 +956,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b6cabb89f340..70da3b52b522 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -237,7 +238,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -310,7 +316,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -446,7 +457,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -518,7 +534,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 014364b7a18e..f41a2c9c0482 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -842,7 +843,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -900,7 +906,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -972,7 +983,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1042,7 +1058,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1104,7 +1125,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1190,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1224,7 +1255,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1284,7 +1320,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1381,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1383,7 +1429,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1596,7 +1647,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1805,7 +1861,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1911,7 +1972,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2118,7 +2184,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2320,7 +2391,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2425,7 +2501,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2531,7 +2612,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2638,7 +2724,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2874,7 +2965,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2944,7 +3040,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 1e639b906eae..cb48084ef73e 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 4cee8dca731c..44258a536655 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -308,7 +314,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -444,7 +455,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -500,7 +516,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f9402a2ce617..4ce880cf0023 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 715de4e3a485..a070a42b8d44 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -178,7 +179,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 26b2168182cb..2895553b86f2 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -279,7 +280,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -350,7 +356,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-10-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -418,7 +429,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -539,7 +555,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -676,7 +697,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_10_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -745,7 +771,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_configuration.py index fef8ed857ef6..b872eb745315 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_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/v2021_11_01_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_configuration.py index e934730db9a8..035aaeaaf3e9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2021_11_01_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 c1f6b6719ed8..9b96e619a710 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -434,7 +450,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -558,7 +579,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -618,7 +644,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -661,7 +692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 d4bf25fdf447..37bb5e536029 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -82,7 +83,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -155,7 +161,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -292,7 +303,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -364,7 +380,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 d8a1f837d4ae..aad2db876017 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -295,7 +311,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -357,7 +378,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -417,7 +443,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -477,7 +508,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -537,7 +573,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -593,7 +634,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -636,7 +682,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -849,7 +900,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1058,7 +1114,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1225,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1372,7 +1438,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1575,7 +1646,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1680,7 +1756,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1786,7 +1867,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1893,7 +1979,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2131,7 +2222,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2201,7 +2297,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 9a6636779c1f..2558fad7df39 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 15960a0d14b6..2794a51a6960 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -75,7 +76,12 @@ async def list( ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -135,7 +141,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -272,7 +283,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -328,7 +344,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 392ddffeca73..49e8561956cf 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 e5b57a9ecbc7..7aa568d22bae 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -135,7 +136,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 7508275ef496..a98486fdb52b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -149,7 +155,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -217,7 +228,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -338,7 +354,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -475,7 +496,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -544,7 +570,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 e457bce978f0..48bb8826b9bb 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -352,7 +353,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -425,7 +431,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -474,7 +485,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -699,7 +715,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -823,7 +844,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -883,7 +909,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -926,7 +957,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 aef694d075fa..71c43bae7996 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -237,7 +238,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -310,7 +316,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -447,7 +458,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -519,7 +535,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 8968e315555d..786ead234ceb 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -842,7 +843,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -900,7 +906,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -972,7 +983,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1042,7 +1058,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1104,7 +1125,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1164,7 +1190,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1224,7 +1255,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1284,7 +1320,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1381,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1383,7 +1429,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1596,7 +1647,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1805,7 +1861,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1911,7 +1972,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2119,7 +2185,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2322,7 +2393,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2427,7 +2503,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2533,7 +2614,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2640,7 +2726,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2878,7 +2969,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2948,7 +3044,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 86e2d8f78430..f4543678ffb0 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 8a829a7dd736..8188be8bc834 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -249,7 +250,12 @@ def list( ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -309,7 +315,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -446,7 +457,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -502,7 +518,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ea4148e1d926..771e767e6b3f 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 2763aaaf4d81..4b94bd14e6e4 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -179,7 +180,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 a641666dd7d4..ac41925e4a22 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -280,7 +281,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -352,7 +358,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -420,7 +431,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -541,7 +557,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -678,7 +699,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2021_11_01_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -747,7 +773,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/_configuration.py index c5699e37e14b..11aaac9ea1c8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/_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/v2022_01_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/_configuration.py index 24607a602205..3a2a186a6b05 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 db50872d6b86..7f1792018151 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -434,7 +450,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -558,7 +579,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -618,7 +644,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -661,7 +692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 6332978e01e8..86a85244989b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -82,7 +83,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -155,7 +161,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -291,7 +302,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -363,7 +379,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 304a01041f61..4da857a204ef 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -295,7 +311,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -357,7 +378,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -417,7 +443,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -487,7 +518,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -548,7 +584,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -604,7 +645,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -647,7 +693,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -860,7 +911,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1069,7 +1125,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1175,7 +1236,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1382,7 +1448,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1584,7 +1655,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1689,7 +1765,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1795,7 +1876,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1902,7 +1988,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2138,7 +2229,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2208,7 +2304,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 987ce5dc9b6a..39de940810cb 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 65f96d2a6af9..8b9e0faaab84 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -74,7 +75,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -134,7 +140,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -270,7 +281,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -326,7 +342,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5675c5b94208..12f4903c1cb9 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 492c4317d3c8..8efcea09e9c5 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -134,7 +135,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 ba13e114f408..2d46d24c11c7 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -149,7 +155,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -217,7 +228,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -338,7 +354,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -475,7 +496,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -544,7 +570,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 08fa9065f933..7dfb9e908f55 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -351,7 +352,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -424,7 +430,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -473,7 +484,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -698,7 +714,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -822,7 +843,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -882,7 +908,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -925,7 +956,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5cda8d833938..eaa4f60f14fe 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -237,7 +238,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -310,7 +316,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -446,7 +457,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -518,7 +534,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 43af50ba21a8..62bbadb015fa 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -845,7 +846,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -903,7 +909,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -975,7 +986,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1045,7 +1061,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1107,7 +1128,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1167,7 +1193,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1237,7 +1268,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1298,7 +1334,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1354,7 +1395,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1397,7 +1443,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1610,7 +1661,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1819,7 +1875,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1925,7 +1986,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2132,7 +2198,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2334,7 +2405,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2439,7 +2515,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2545,7 +2626,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2652,7 +2738,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2888,7 +2979,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2958,7 +3054,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 0d67abefcf50..b9da92f60841 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 9cc143b575ec..1cc6194c2cde 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -248,7 +249,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -308,7 +314,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -444,7 +455,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -500,7 +516,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 09568535545a..20863af78a3b 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 1b684ebd05fc..604b7fd1f86f 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -178,7 +179,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 1aa91e8e460f..e5a6bb401f85 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -279,7 +280,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -350,7 +356,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -418,7 +429,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -539,7 +555,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -676,7 +697,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_01_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -745,7 +771,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/_configuration.py index 719538efecd2..b5ccebe02c32 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_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/v2022_01_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/_configuration.py index 1c88c2c1bb82..999599c59cf6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_01_02_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 4ac9db088e59..7963c65d3e31 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -84,7 +85,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -206,7 +217,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -434,7 +450,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -558,7 +579,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -618,7 +644,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -661,7 +692,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 03fe24bd90dc..24317f2ffa12 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -82,7 +83,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -155,7 +161,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -292,7 +303,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -364,7 +380,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 0a9289cb4a60..0380ca6616ce 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -225,7 +236,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -295,7 +311,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -357,7 +378,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -427,7 +453,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -488,7 +519,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -548,7 +584,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -604,7 +645,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -647,7 +693,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -860,7 +911,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1069,7 +1125,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1175,7 +1236,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1383,7 +1449,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1586,7 +1657,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1691,7 +1767,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1797,7 +1878,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1904,7 +1990,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2142,7 +2233,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2212,7 +2308,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 72e8737df71e..fb60c80edd8c 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 e4865b897156..ba9a798651b3 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -75,7 +76,12 @@ async def list( ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -135,7 +141,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -272,7 +283,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -328,7 +344,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 e26ddc6fe686..0d437336734e 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -67,7 +68,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 9f0d14d633f0..75b0a5cacd89 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -135,7 +136,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 96b5f6da212d..c96f2b3e94b1 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -149,7 +155,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -217,7 +228,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -338,7 +354,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -475,7 +496,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -544,7 +570,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 577a3c6044cc..101042f43317 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -352,7 +353,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -425,7 +431,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -474,7 +485,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -699,7 +715,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -823,7 +844,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -883,7 +909,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -926,7 +957,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 041d35e34a53..8a5f76cec7f5 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -237,7 +238,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -310,7 +316,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -447,7 +458,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -519,7 +535,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4a959326c00e..de275bd2b29f 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -845,7 +846,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -903,7 +909,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -975,7 +986,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1045,7 +1061,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1107,7 +1128,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1177,7 +1203,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1238,7 +1269,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1298,7 +1334,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1354,7 +1395,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1397,7 +1443,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1610,7 +1661,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1819,7 +1875,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1925,7 +1986,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2133,7 +2199,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2336,7 +2407,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2441,7 +2517,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2547,7 +2628,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2654,7 +2740,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2892,7 +2983,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2962,7 +3058,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 76daf8a47595..104ddfff000c 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 e55e556e4033..455ddd3585a6 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -249,7 +250,12 @@ def list( ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -309,7 +315,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -446,7 +457,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -502,7 +518,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 2a2532132fd7..8be82ce82264 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -108,7 +109,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 0a5c8e36684b..5d1204b525fb 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -179,7 +180,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 1f2c8fc5432c..edbdc8f65d57 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -280,7 +281,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -352,7 +358,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-01-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -420,7 +431,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -541,7 +557,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -678,7 +699,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_01_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -747,7 +773,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/_configuration.py index a1d64437efc4..f39a217fea6a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/_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/v2022_02_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/_configuration.py index 8c064b3687a0..0b0c7565d7b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 8c32336fd359..a1e4d88033c7 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -159,7 +165,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -208,7 +219,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -439,7 +455,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +586,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -626,7 +652,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -669,7 +700,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 9530f77f67e9..bb8dce6025f3 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -296,7 +307,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -369,7 +385,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b7ef4c61c87e..c6660310165e 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -226,7 +237,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -297,7 +313,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -360,7 +381,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -421,7 +447,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -492,7 +523,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +590,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -611,7 +652,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -654,7 +700,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -870,7 +921,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1082,7 +1138,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1189,7 +1250,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1399,7 +1465,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1604,7 +1675,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1710,7 +1786,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1817,7 +1898,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1925,7 +2011,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2165,7 +2256,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2236,7 +2332,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 d4f62778b86d..32a74db2188a 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 2455803277ee..c0018b1ac8ba 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -75,7 +76,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -136,7 +142,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -275,7 +286,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -331,7 +347,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 6e998ffd1d0a..3685ce5f2c85 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -68,7 +69,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 8147057ce0af..701b6f3c60c2 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -137,7 +138,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 ab11f02a7b91..a282b13154f4 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -150,7 +156,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -219,7 +230,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -343,7 +359,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -483,7 +504,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -553,7 +579,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 1bcd83e7e2bf..8075c63457c0 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -366,7 +367,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -440,7 +446,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -489,7 +500,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -717,7 +733,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -843,7 +864,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -904,7 +930,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -947,7 +978,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 2e82da1fb2ab..20ee34dd507d 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -246,7 +247,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -320,7 +326,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -459,7 +470,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -532,7 +548,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b427fd4310ea..68e3de12b964 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -881,7 +882,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -939,7 +945,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1012,7 +1023,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1083,7 +1099,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1146,7 +1167,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1207,7 +1233,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1278,7 +1309,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1376,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1397,7 +1438,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1440,7 +1486,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1656,7 +1707,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1868,7 +1924,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1975,7 +2036,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2185,7 +2251,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2390,7 +2461,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2496,7 +2572,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2603,7 +2684,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2711,7 +2797,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2951,7 +3042,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3022,7 +3118,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 cb2d978d70c3..c42e13d51233 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 9aec38b0e548..cdfb07e1fd37 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -257,7 +258,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -318,7 +324,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -457,7 +468,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -513,7 +529,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c7e7301a85ad..611dd0242fca 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -111,7 +112,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 47e6b86d8686..208b16053f8b 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -183,7 +184,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 f108cf85cc15..b65dfda996c0 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -289,7 +290,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -361,7 +367,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -430,7 +441,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +570,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -694,7 +715,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -764,7 +790,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/_configuration.py index 7c20974867de..9e468118e51e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_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/v2022_02_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/_configuration.py index f451fbf5fc75..68c13fc1a5f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 38b7b15452dc..c2fe41ddb389 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -159,7 +165,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -208,7 +219,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -439,7 +455,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +586,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -626,7 +652,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -669,7 +700,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 0bfe50bf20bc..44830fcee83b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -297,7 +308,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -370,7 +386,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5ae5e89e7b17..81c9b9634038 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -78,7 +79,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -154,7 +160,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -223,7 +234,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -353,7 +369,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -495,7 +516,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -565,7 +591,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5cc5af382486..2352cd5e81e9 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -226,7 +237,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -297,7 +313,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -360,7 +381,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -421,7 +447,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -492,7 +523,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +590,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -611,7 +652,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -654,7 +700,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -870,7 +921,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1082,7 +1138,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1189,7 +1250,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1400,7 +1466,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1606,7 +1677,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1712,7 +1788,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1819,7 +1900,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1927,7 +2013,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2169,7 +2260,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2240,7 +2336,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 9b1637b895f4..93711c32a948 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 8ef360d2243d..c53da1683902 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -76,7 +77,12 @@ async def list( ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -137,7 +143,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -277,7 +288,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -333,7 +349,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 21d3d84a7648..e799318f22f1 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -68,7 +69,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 6275cee35afa..16d1a14cbe5d 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -138,7 +139,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 bc695bac5f2c..9b3359d36b5a 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -150,7 +156,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -219,7 +230,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -343,7 +359,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -483,7 +504,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -553,7 +579,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4c874496b584..4951f16b1bba 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -367,7 +368,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -441,7 +447,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -490,7 +501,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -718,7 +734,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -844,7 +865,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -905,7 +931,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -948,7 +979,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 00f81ac3bc2c..021a90994bd7 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -246,7 +247,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -320,7 +326,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -460,7 +471,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -533,7 +549,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 e0f7b498a33d..bee2511843d2 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -293,7 +294,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -369,7 +375,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -438,7 +449,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -568,7 +584,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -710,7 +731,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -780,7 +806,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 164b7f16e64a..8ba9e9f6b561 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -881,7 +882,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -939,7 +945,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1012,7 +1023,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1083,7 +1099,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1146,7 +1167,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1207,7 +1233,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1278,7 +1309,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1376,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1397,7 +1438,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1440,7 +1486,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1656,7 +1707,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1868,7 +1924,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1975,7 +2036,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2186,7 +2252,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2392,7 +2463,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2498,7 +2574,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2605,7 +2686,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2713,7 +2799,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2955,7 +3046,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3026,7 +3122,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 fe868dd022fb..43c5f359d39e 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 29db7ee8fc3d..79346650074c 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -258,7 +259,12 @@ def list( ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -319,7 +325,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -459,7 +470,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -515,7 +531,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 012fa2e827d2..c26d0a21a445 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -111,7 +112,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 43ca8a470171..9e1921fad250 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -184,7 +185,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 bf0a769a70aa..85012185691a 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -290,7 +291,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -363,7 +369,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-02-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -432,7 +443,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -556,7 +572,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -696,7 +717,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_02_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -766,7 +792,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/_configuration.py index a80d9730f82f..ba0b04046be4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/_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/v2022_03_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/_configuration.py index da727b998356..b4e80413491a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 f32685c4812d..199c1751ef0f 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -159,7 +165,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -208,7 +219,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -439,7 +455,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +586,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -626,7 +652,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -669,7 +700,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3ec176912911..83cfc850ecc6 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -296,7 +307,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -369,7 +385,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 465ad6dbd36e..b52605bd5319 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -226,7 +237,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -297,7 +313,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -360,7 +381,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -421,7 +447,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -492,7 +523,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +590,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -611,7 +652,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -654,7 +700,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -870,7 +921,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1082,7 +1138,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1189,7 +1250,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1399,7 +1465,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1604,7 +1675,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1710,7 +1786,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1817,7 +1898,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1925,7 +2011,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2165,7 +2256,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2236,7 +2332,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 17226084bb23..27374525852b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 82ddc199c100..ac1ddf63dca5 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -75,7 +76,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -136,7 +142,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -275,7 +286,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -331,7 +347,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f053a9a473e0..696478081654 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -68,7 +69,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ee1b022a6a0a..f47c6cce6666 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -137,7 +138,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 4b8e398d8e46..3cba4cfb5157 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -150,7 +156,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -219,7 +230,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -343,7 +359,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -483,7 +504,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -553,7 +579,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 873d7eb1c9a2..7f3f3bc2d1fd 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -366,7 +367,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -440,7 +446,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -489,7 +500,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -717,7 +733,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -843,7 +864,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -904,7 +930,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -947,7 +978,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 678f4ca3f651..42c6aa07e3ee 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -246,7 +247,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -320,7 +326,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -459,7 +470,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -532,7 +548,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c773e5630dcc..38107b8259df 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -881,7 +882,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -939,7 +945,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1012,7 +1023,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1083,7 +1099,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1146,7 +1167,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1207,7 +1233,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1278,7 +1309,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1376,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1397,7 +1438,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1440,7 +1486,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1656,7 +1707,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1868,7 +1924,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1975,7 +2036,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2185,7 +2251,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2390,7 +2461,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2496,7 +2572,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2603,7 +2684,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2711,7 +2797,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2951,7 +3042,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3022,7 +3118,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 31e3e24c5920..e752103a797e 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 c56af3019c00..63dc182ce53e 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -257,7 +258,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -318,7 +324,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -457,7 +468,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -513,7 +529,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 98814cbbd403..4471353caa95 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -111,7 +112,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 171553672744..ab79f9644df7 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -183,7 +184,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 f1466add7fb5..6bad26a79396 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -289,7 +290,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -361,7 +367,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -430,7 +441,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +570,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -694,7 +715,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -764,7 +790,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/_configuration.py index 11076b348f4b..42c916121b63 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_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/v2022_03_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/_configuration.py index 75d0806611a4..e801fc143bb2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_03_02_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 50cbc1aff1b2..b962f657ead3 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -159,7 +165,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -208,7 +219,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -444,7 +460,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -580,7 +601,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -641,7 +667,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -684,7 +715,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 93509d4581e6..ec2327af51f8 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -297,7 +308,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -370,7 +386,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 eda90e8b1f2f..4617c3c2158b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -78,7 +79,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -154,7 +160,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -223,7 +234,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -353,7 +369,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -495,7 +516,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -565,7 +591,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4b445e715d9e..0dbfccbdf512 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -94,7 +95,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -152,7 +158,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -227,7 +238,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -298,7 +314,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -361,7 +382,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -422,7 +448,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -493,7 +524,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -555,7 +591,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -612,7 +653,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -655,7 +701,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -871,7 +922,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1087,7 +1143,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1205,7 +1266,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1416,7 +1482,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1622,7 +1693,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1728,7 +1804,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1833,7 +1914,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1940,7 +2026,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2048,7 +2139,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2290,7 +2386,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2361,7 +2462,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 2744b9d15c53..59d766fa1f76 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 f283c3139ad3..0a399bb83691 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -76,7 +77,12 @@ async def list( ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -137,7 +143,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -277,7 +288,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -333,7 +349,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 6cf9d31dde86..3a306673ef1a 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -68,7 +69,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 67ad73705298..dedeeb020201 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -138,7 +139,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 c79b90cbeb41..82dbc7872cb6 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -150,7 +156,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -219,7 +230,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -343,7 +359,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -483,7 +504,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -553,7 +579,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 19d28753b013..0f581af893b1 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -377,7 +378,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -451,7 +457,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -500,7 +511,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -733,7 +749,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -869,7 +890,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -930,7 +956,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -973,7 +1004,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5b83f5b1528b..57795b01932c 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -246,7 +247,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -320,7 +326,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -460,7 +471,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -533,7 +549,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5208042284d6..86d04d633298 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -293,7 +294,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -369,7 +375,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -438,7 +449,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -568,7 +584,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -710,7 +731,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -780,7 +806,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 9975c6a015c8..9422328611e1 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -930,7 +931,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -988,7 +994,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1061,7 +1072,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1132,7 +1148,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1195,7 +1216,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1256,7 +1282,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1327,7 +1358,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1389,7 +1425,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1446,7 +1487,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1489,7 +1535,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1705,7 +1756,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1921,7 +1977,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2039,7 +2100,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2250,7 +2316,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2456,7 +2527,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2562,7 +2638,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2667,7 +2748,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2774,7 +2860,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2882,7 +2973,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3124,7 +3220,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3195,7 +3296,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 19fda0f7ef74..d70d371ff675 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 4c0074e2e12e..74dfb5b41411 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -258,7 +259,12 @@ def list( ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -319,7 +325,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -459,7 +470,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -515,7 +531,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 249fad06ff6b..461282621a70 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -111,7 +112,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 bbb711a97711..9ca5c4963408 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -184,7 +185,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 ab83a7944759..042f78d4eba4 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -290,7 +291,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -363,7 +369,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-03-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -432,7 +443,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -556,7 +572,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -696,7 +717,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_03_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -766,7 +792,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/_configuration.py index a58b14117304..1cb67a258fdb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/_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/v2022_04_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/_configuration.py index f42ad5e8b3d4..60ca5d637d58 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 717370867d1a..f0296f90b1a0 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -159,7 +165,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -208,7 +219,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -439,7 +455,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +586,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -626,7 +652,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -669,7 +700,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 2ea4f6b232fb..86e0815c28a8 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -296,7 +307,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -369,7 +385,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 2294739b37f6..b4504d5369d4 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -226,7 +237,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -297,7 +313,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -360,7 +381,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -421,7 +447,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -492,7 +523,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +590,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -611,7 +652,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -654,7 +700,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -870,7 +921,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1082,7 +1138,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1189,7 +1250,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1399,7 +1465,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1604,7 +1675,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1710,7 +1786,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1817,7 +1898,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1925,7 +2011,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2165,7 +2256,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2236,7 +2332,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 1bd64ab3cf30..89ef732b4e84 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 709e444af8eb..0b5ef9642955 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -75,7 +76,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -136,7 +142,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -275,7 +286,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -331,7 +347,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 3e190605b8c2..e258fd56f508 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -68,7 +69,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ab3a66818a3d..4006c216997b 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -137,7 +138,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 2598c3831991..14946a010960 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -150,7 +156,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -219,7 +230,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -343,7 +359,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -483,7 +504,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -553,7 +579,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 ac6400943229..05d2f87353a7 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -366,7 +367,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -440,7 +446,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -489,7 +500,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -717,7 +733,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -843,7 +864,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -904,7 +930,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -947,7 +978,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 431d815178ba..ad1c4f929e2f 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -246,7 +247,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -320,7 +326,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -459,7 +470,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -532,7 +548,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 831305876f05..aa91db27ad51 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -881,7 +882,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -939,7 +945,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1012,7 +1023,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1083,7 +1099,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1146,7 +1167,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1207,7 +1233,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1278,7 +1309,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1376,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1397,7 +1438,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1440,7 +1486,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1656,7 +1707,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1868,7 +1924,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1975,7 +2036,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2185,7 +2251,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2390,7 +2461,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2496,7 +2572,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2603,7 +2684,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2711,7 +2797,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2951,7 +3042,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3022,7 +3118,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 e8db3243431a..b32299bc97bc 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 d9f01d941332..ed2b5ca55a11 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -257,7 +258,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -318,7 +324,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -457,7 +468,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -513,7 +529,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 df264f6f184c..4af17df3501c 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -111,7 +112,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 19db3aab7a41..3d021ef84f33 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -183,7 +184,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 fe561e3f6634..0c8e5d8c947d 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -289,7 +290,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -361,7 +367,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -430,7 +441,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +570,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -694,7 +715,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -764,7 +790,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/_configuration.py index 6769ca91635c..cc2d1c4d9dc7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_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/v2022_04_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/_configuration.py index 8cea37c33508..e13ee603b45f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_04_02_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 806cc5397fc3..4f76c89bd920 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -159,7 +165,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -208,7 +219,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -444,7 +460,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -580,7 +601,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -641,7 +667,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -684,7 +715,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 8601c6f92dd0..87a08aa68bf8 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -297,7 +308,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -370,7 +386,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a0ae99329c57..a1d8dce4c7b4 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -78,7 +79,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -154,7 +160,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -223,7 +234,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -353,7 +369,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -495,7 +516,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -565,7 +591,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c9a67997ce54..13301809d595 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -94,7 +95,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -152,7 +158,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -227,7 +238,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -298,7 +314,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -361,7 +382,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -422,7 +448,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -493,7 +524,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -555,7 +591,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -612,7 +653,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -655,7 +701,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -871,7 +922,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1087,7 +1143,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1205,7 +1266,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1416,7 +1482,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1622,7 +1693,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1728,7 +1804,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1833,7 +1914,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1940,7 +2026,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2048,7 +2139,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2290,7 +2386,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2361,7 +2462,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 3a37f9f92945..540a139e6a71 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 aa8bcc2dfbff..2bc03ccc090d 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -76,7 +77,12 @@ async def list( ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -137,7 +143,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -277,7 +288,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -333,7 +349,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 e3203e84ecfc..d6de05a450f6 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -68,7 +69,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 fc99088b85ba..8575f0b2fcd0 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -138,7 +139,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 ef3dc75f487e..945257ff7d42 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -150,7 +156,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -219,7 +230,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -343,7 +359,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -483,7 +504,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -553,7 +579,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 85e8420f78c7..21b9dc2fbb3b 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -297,7 +308,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -370,7 +386,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f78068e9582a..1834b991a997 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -71,7 +72,12 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 948e9f8cf6a6..fef04a7d8ff3 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -377,7 +378,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -451,7 +457,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -500,7 +511,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -733,7 +749,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -869,7 +890,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -930,7 +956,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -973,7 +1004,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c04a57241fbb..50f7fbba4f8d 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -246,7 +247,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -320,7 +326,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -460,7 +471,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -533,7 +549,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c9498bff4d92..7636a9592388 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -293,7 +294,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -369,7 +375,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -438,7 +449,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -568,7 +584,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -710,7 +731,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -780,7 +806,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c65e408febb3..ad8a578cf6d2 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -930,7 +931,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -988,7 +994,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1061,7 +1072,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1132,7 +1148,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1195,7 +1216,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1256,7 +1282,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1327,7 +1358,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1389,7 +1425,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1446,7 +1487,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1489,7 +1535,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1705,7 +1756,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1921,7 +1977,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2039,7 +2100,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2250,7 +2316,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2456,7 +2527,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2562,7 +2638,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2667,7 +2748,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2774,7 +2860,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2882,7 +2973,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3124,7 +3220,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3195,7 +3296,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 597e8d4b6096..e4611d00db32 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 81bcd6cf26d7..119f47c09e65 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -258,7 +259,12 @@ def list( ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -319,7 +325,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -459,7 +470,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -515,7 +531,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 819e17486e01..52a34be4b71d 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -111,7 +112,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 52ade14eb4fe..0bdc809d89ed 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -184,7 +185,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 74a1ed50280e..b9da7358fd63 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -290,7 +291,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -363,7 +369,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -432,7 +443,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -556,7 +572,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -696,7 +717,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -766,7 +792,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 7ae4638b1410..5512074d5fdd 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -264,7 +265,12 @@ def list( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -338,7 +344,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -478,7 +489,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_04_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -551,7 +567,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 a04e83345854..b58849599822 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -102,7 +103,12 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-04-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/_configuration.py index a0270a521d4d..cb284fd99b8a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_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/v2022_05_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/_configuration.py index 9a9dac2c2c79..f3a9c43da135 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_05_02_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 9360a8ea9816..f82ccd411806 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -159,7 +165,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -208,7 +219,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -444,7 +460,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -580,7 +601,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -641,7 +667,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -684,7 +715,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 955f11d44b47..373850112dd9 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -297,7 +308,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -370,7 +386,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5b4a01622afe..9a40f4a3ae43 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -78,7 +79,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -154,7 +160,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -223,7 +234,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -353,7 +369,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -495,7 +516,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -565,7 +591,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 7bcfb6eb03c2..1280d2029eb5 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -94,7 +95,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -152,7 +158,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -227,7 +238,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -298,7 +314,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -361,7 +382,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -422,7 +448,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -493,7 +524,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -555,7 +591,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -612,7 +653,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -655,7 +701,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -871,7 +922,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1087,7 +1143,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1205,7 +1266,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1416,7 +1482,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1622,7 +1693,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1728,7 +1804,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1833,7 +1914,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1940,7 +2026,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2048,7 +2139,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2290,7 +2386,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2361,7 +2462,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 e8af220164e5..a948303015cb 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 461b7ba1ee12..cfb6f3e4e897 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -76,7 +77,12 @@ async def list( ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -137,7 +143,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -277,7 +288,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -333,7 +349,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 575ab7a06dd1..ce969c166a0f 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -68,7 +69,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5a33f1693560..62ec448194c3 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -138,7 +139,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 fa5d9c004b0f..f74c14c0a71f 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -150,7 +156,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -219,7 +230,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -343,7 +359,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -483,7 +504,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -553,7 +579,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 9758a0272707..94bb973f5c4c 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -297,7 +308,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -370,7 +386,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 41f6e5a2f12e..f1ec215c6883 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -71,7 +72,12 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 d057ede8e933..7e0572ccc35d 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -377,7 +378,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -451,7 +457,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -500,7 +511,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -733,7 +749,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -869,7 +890,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -930,7 +956,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -973,7 +1004,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c56d84584354..98fb757ce4a5 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -246,7 +247,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -320,7 +326,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -460,7 +471,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -533,7 +549,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f251cf7dd99a..cb0dfb8af7c2 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -293,7 +294,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -369,7 +375,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -438,7 +449,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -568,7 +584,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -710,7 +731,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -780,7 +806,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b5237ad97391..ae0b0017da60 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -930,7 +931,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -988,7 +994,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1061,7 +1072,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1132,7 +1148,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1195,7 +1216,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1256,7 +1282,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1327,7 +1358,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1389,7 +1425,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1446,7 +1487,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1489,7 +1535,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1705,7 +1756,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1921,7 +1977,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2039,7 +2100,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2250,7 +2316,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2456,7 +2527,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2562,7 +2638,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2667,7 +2748,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2774,7 +2860,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2882,7 +2973,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3124,7 +3220,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3195,7 +3296,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 32f251ca2051..6891b47a1455 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 c2e4aae7a4bd..42e74c1e8a38 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -258,7 +259,12 @@ def list( ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -319,7 +325,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -459,7 +470,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -515,7 +531,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 87aa01746a32..646feb840b35 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -111,7 +112,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b3ddc5387868..459332f2e169 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -184,7 +185,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 eb1651fc30f2..d522b5df416c 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -290,7 +291,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -363,7 +369,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -432,7 +443,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -556,7 +572,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -696,7 +717,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -766,7 +792,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 1787730331f2..cb986a4b0ea1 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -264,7 +265,12 @@ def list( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -338,7 +344,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -478,7 +489,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_05_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -551,7 +567,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 726ba5c31f25..87238c385747 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -102,7 +103,12 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-05-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/_configuration.py index 03439ff25e6b..0e67528a53eb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/_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/v2022_06_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/_configuration.py index ce14e51b7954..aea4dff93209 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 d621a95b95bf..9e0c903800ea 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -159,7 +165,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -208,7 +219,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -439,7 +455,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +586,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -626,7 +652,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -669,7 +700,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 1d1526fbba0b..ea32462a7604 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -296,7 +307,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -369,7 +385,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 5ce7c8f05baa..606cfc9211fd 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -226,7 +237,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -297,7 +313,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -360,7 +381,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -421,7 +447,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -492,7 +523,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +590,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -611,7 +652,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -654,7 +700,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -870,7 +921,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1082,7 +1138,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1189,7 +1250,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1399,7 +1465,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1604,7 +1675,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1710,7 +1786,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1817,7 +1898,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1925,7 +2011,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2165,7 +2256,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2236,7 +2332,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 f596080d7ce5..c2c49dbea22a 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 26d498de0736..0e5443344ef7 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -75,7 +76,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -136,7 +142,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -275,7 +286,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -331,7 +347,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 39b08bc844c2..4dff254b2234 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -68,7 +69,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 cd65a1fe5766..37f42567bce8 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -137,7 +138,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 dd7eb736eeb8..13fb320ace2e 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -150,7 +156,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -219,7 +230,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -343,7 +359,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -483,7 +504,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -553,7 +579,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 81b85041db25..d6b420a8fe91 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -366,7 +367,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -440,7 +446,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -489,7 +500,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -717,7 +733,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -843,7 +864,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -904,7 +930,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -947,7 +978,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 0854da805e6b..ae8cce7ea419 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -246,7 +247,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -320,7 +326,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -459,7 +470,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -532,7 +548,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 484f24006d2c..e1cf14394773 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -881,7 +882,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -939,7 +945,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1012,7 +1023,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1083,7 +1099,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1146,7 +1167,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1207,7 +1233,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1278,7 +1309,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1376,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1397,7 +1438,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1440,7 +1486,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1656,7 +1707,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1868,7 +1924,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1975,7 +2036,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2185,7 +2251,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2390,7 +2461,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2496,7 +2572,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2603,7 +2684,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2711,7 +2797,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2951,7 +3042,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3022,7 +3118,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 562044058733..d3cee32e8533 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 6037a5916c4d..e04d74ef257a 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -257,7 +258,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -318,7 +324,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -457,7 +468,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -513,7 +529,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 7810f3cbbd44..36ec0b7bc19f 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -111,7 +112,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 79aabe13af6a..827a16758746 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -183,7 +184,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 3f9a76e3222d..b5d1c0e1962e 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -289,7 +290,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -361,7 +367,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -430,7 +441,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +570,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -694,7 +715,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -764,7 +790,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/_configuration.py index 2a671fe3df50..e99bd8745017 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_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/v2022_06_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/_configuration.py index 712bbef192dd..60ec6ce4ccb8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_06_02_preview/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 5101b7e4c6b5..a8304f4e4ec4 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -159,7 +165,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -208,7 +219,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -444,7 +460,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -580,7 +601,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -641,7 +667,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -684,7 +715,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 08343a2a4b44..4e831268dd78 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ async def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.FleetMember: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -355,7 +361,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.FleetMember :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -405,7 +416,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -551,7 +567,12 @@ def list_by_fleet( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetMembersListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 841a96eed23b..93c567582580 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -71,7 +72,12 @@ async def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.Fleet: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -423,7 +429,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -496,7 +507,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -540,7 +556,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -672,7 +693,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -744,7 +770,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -815,7 +846,12 @@ async def list_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.FleetCredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 4f37457cc8d0..088e2c244078 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -297,7 +308,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -370,7 +386,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 8b18978d1e36..771c50f3eeb7 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -78,7 +79,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedClusterSnapshot"] api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -154,7 +160,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -223,7 +234,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -353,7 +369,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -495,7 +516,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -565,7 +591,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 24dc8c88ff90..86cec4f50502 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -94,7 +95,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -152,7 +158,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -227,7 +238,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -298,7 +314,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -361,7 +382,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -422,7 +448,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -493,7 +524,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -555,7 +591,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -612,7 +653,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -655,7 +701,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -871,7 +922,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1087,7 +1143,12 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1205,7 +1266,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1416,7 +1482,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1622,7 +1693,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1728,7 +1804,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1833,7 +1914,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1940,7 +2026,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2048,7 +2139,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2290,7 +2386,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2361,7 +2462,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 cbbb1758702f..8cc2811f222c 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 a895ed2ed27c..fb6d56922e73 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -76,7 +77,12 @@ async def list( ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -137,7 +143,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -277,7 +288,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -333,7 +349,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 2dabe15e553b..17562200d5f3 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -68,7 +69,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 527a4e372e24..2bf0635696a5 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -138,7 +139,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 b198396ddc3a..c65f297eb6f4 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -150,7 +156,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -219,7 +230,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -343,7 +359,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -483,7 +504,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -553,7 +579,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 9f1798abe98d..a86b3f9ef475 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -297,7 +308,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -370,7 +386,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 2ffbc1cca901..64ceb3f23880 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -71,7 +72,12 @@ def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAc api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 909600012447..7fe4b6c74e56 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -377,7 +378,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -451,7 +457,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -500,7 +511,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -733,7 +749,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -869,7 +890,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -930,7 +956,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -973,7 +1004,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 aa0cf6d3c2a6..1fdadf777c8e 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -252,7 +253,12 @@ def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.FleetMember: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -538,7 +544,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.FleetMember :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -588,7 +599,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if_match: Optional[str] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -734,7 +750,12 @@ def list_by_fleet( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetMembersListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 49242feee757..d6a3e815d77a 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -312,7 +313,12 @@ def _create_or_update_initial( if_none_match: Optional[str] = None, **kwargs: Any ) -> _models.Fleet: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -664,7 +670,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Fleet :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -737,7 +748,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -781,7 +797,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -913,7 +934,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -985,7 +1011,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Fleet"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1056,7 +1087,12 @@ def list_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.FleetCredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 bbae55243ace..0e29d5e09ab3 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -246,7 +247,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -320,7 +326,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -460,7 +471,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -533,7 +549,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 f1575dd7c1a0..0022a69c2e29 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -293,7 +294,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedClusterSnapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -369,7 +375,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -438,7 +449,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -568,7 +584,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -710,7 +731,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterSnapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -780,7 +806,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 cb91e6ffeeb8..7456b5b4535a 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -930,7 +931,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -988,7 +994,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1061,7 +1072,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1132,7 +1148,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1195,7 +1216,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1256,7 +1282,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1327,7 +1358,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1389,7 +1425,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1446,7 +1487,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1489,7 +1535,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1705,7 +1756,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1921,7 +1977,12 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements ignore_pod_disruption_budget: Optional[bool] = None, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2039,7 +2100,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2250,7 +2316,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2456,7 +2527,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2562,7 +2638,12 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2667,7 +2748,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2774,7 +2860,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2882,7 +2973,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3124,7 +3220,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3195,7 +3296,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 ab66bf4e24cd..1391e8228057 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 38aaed94e332..780e1485c1ec 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -258,7 +259,12 @@ def list( ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -319,7 +325,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -459,7 +470,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -515,7 +531,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 93dd66c845f8..a7bd8c4be6a1 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -111,7 +112,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 66ab583bc867..a39136164abc 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -184,7 +185,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 6bf74b53ca07..380eb142fc9b 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -290,7 +291,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -363,7 +369,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -432,7 +443,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -556,7 +572,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -696,7 +717,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -766,7 +792,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 7f31ca15c3f6..7775ed506c8c 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -264,7 +265,12 @@ def list( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -338,7 +344,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -478,7 +489,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_06_02_preview.models.TrustedAccessRoleBinding :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -551,7 +567,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 40f7e03f661c..7bee50013c9e 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -102,7 +103,12 @@ def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessR api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-06-02-preview")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/__init__.py index a8716d29afe8..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/_configuration.py index 51f785faf2a8..eb85c21d33ff 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/_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/v2022_07_01/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/_configuration.py index 58ec3f2078ed..238958645973 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_01/aio/_configuration.py @@ -12,12 +12,12 @@ 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 -VERSION = "unknown" - class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. 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 40642b19eb4a..f7ba2bb6ca39 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -85,7 +86,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> A api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -159,7 +165,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -208,7 +219,12 @@ async def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -439,7 +455,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -565,7 +586,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -626,7 +652,12 @@ async def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -669,7 +700,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 e32d2355fa48..4ee001732d88 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -83,7 +84,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -157,7 +163,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -296,7 +307,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -369,7 +385,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 b45fe1249f07..f35c00469911 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -93,7 +94,12 @@ async def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -151,7 +157,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -226,7 +237,12 @@ def list_by_resource_group( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -297,7 +313,12 @@ async def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -360,7 +381,12 @@ async def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -421,7 +447,12 @@ async def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -492,7 +523,12 @@ async def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +590,12 @@ async def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -611,7 +652,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -654,7 +700,12 @@ async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) async def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -870,7 +921,12 @@ def get_long_running_output(pipeline_response): async def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1082,7 +1138,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1189,7 +1250,12 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1399,7 +1465,12 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1604,7 +1675,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1710,7 +1786,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1817,7 +1898,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1925,7 +2011,12 @@ async def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2165,7 +2256,12 @@ async def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2236,7 +2332,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 d0d2d16b0532..ee8d8c16a51c 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -69,7 +70,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 3b50a62d5f99..4b03efa808b1 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -75,7 +76,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -136,7 +142,12 @@ async def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -275,7 +286,12 @@ async def update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -331,7 +347,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 bd6b0f9f8054..66d1670efdbe 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -68,7 +69,12 @@ async def list( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 c15540b03ee9..406ef28d2856 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -137,7 +138,12 @@ async def post( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 977300ab203d..e8b9d20e0d65 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 @@ -15,6 +15,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -77,7 +78,12 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -150,7 +156,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -219,7 +230,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -343,7 +359,12 @@ async def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -483,7 +504,12 @@ async def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -553,7 +579,12 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 e23d6c03b003..227ed2699b91 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -366,7 +367,12 @@ def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> I api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -440,7 +446,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPool :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -489,7 +500,12 @@ def _create_or_update_initial( parameters: Union[_models.AgentPool, IO], **kwargs: Any ) -> _models.AgentPool: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -717,7 +733,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -843,7 +864,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPoolUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -904,7 +930,12 @@ def get_available_agent_pool_versions( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.AgentPoolAvailableVersions :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -947,7 +978,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 bc62823fca84..1eadbf779c73 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -246,7 +247,12 @@ def list_by_managed_cluster( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -320,7 +326,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -459,7 +470,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.MaintenanceConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -532,7 +548,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 db75f7e97cd9..d890c2fe1f1c 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -881,7 +882,12 @@ def get_os_options( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.OSOptionProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -939,7 +945,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.ManagedCluster"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1012,7 +1023,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -1083,7 +1099,12 @@ def get_upgrade_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.ManagedClusterUpgradeProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1146,7 +1167,12 @@ def get_access_profile( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.ManagedClusterAccessProfile :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1207,7 +1233,12 @@ def list_cluster_admin_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1278,7 +1309,12 @@ def list_cluster_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1340,7 +1376,12 @@ def list_cluster_monitoring_user_credentials( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.CredentialResults :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1397,7 +1438,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1440,7 +1486,12 @@ def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _m def _create_or_update_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1656,7 +1707,12 @@ def get_long_running_output(pipeline_response): def _update_tags_initial( self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1868,7 +1924,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -1975,7 +2036,12 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2185,7 +2251,12 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement parameters: Union[_models.ManagedClusterAADProfile, IO], **kwargs: Any ) -> None: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2390,7 +2461,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2496,7 +2572,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2603,7 +2684,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -2711,7 +2797,12 @@ def _run_command_initial( request_payload: Union[_models.RunCommandRequest, IO], **kwargs: Any ) -> Optional[_models.RunCommandResult]: - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2951,7 +3042,12 @@ def get_command_result( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.RunCommandResult or None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -3022,7 +3118,12 @@ def list_outbound_network_dependencies_endpoints( api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 69c684cbcd19..8b8e310fb01f 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -91,7 +92,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): 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 b4dee5fc2fff..f08a0a388443 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -257,7 +258,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnectionListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -318,7 +324,12 @@ def get( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -457,7 +468,12 @@ def update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateEndpointConnection :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -513,7 +529,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 fbc1cf186fd3..068848465e46 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -111,7 +112,12 @@ def list( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateLinkResourcesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} 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 fb5c7e86c392..feed91d745cb 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 @@ -13,6 +13,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse @@ -183,7 +184,12 @@ def post( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.PrivateLinkResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) 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 5a954c59168e..352be3935aaa 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 @@ -14,6 +14,7 @@ HttpResponseError, ResourceExistsError, ResourceNotFoundError, + ResourceNotModifiedError, map_error, ) from azure.core.paging import ItemPaged @@ -289,7 +290,12 @@ def list(self, **kwargs: Any) -> Iterable["_models.Snapshot"]: api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -361,7 +367,12 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-01")) # type: str cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) def prepare_request(next_link=None): @@ -430,7 +441,12 @@ 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 = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} @@ -554,7 +570,12 @@ def create_or_update( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -694,7 +715,12 @@ def update_tags( :rtype: ~azure.mgmt.containerservice.v2022_07_01.models.Snapshot :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -764,7 +790,12 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError} + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/__init__.py index 37a5f9e02e6f..a88d6dee97f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._container_service_client import ContainerServiceClient +from ._version import VERSION + +__version__ = VERSION try: from ._patch import __all__ as _patch_all @@ -14,7 +17,8 @@ except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ['ContainerServiceClient'] + +__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/v2022_07_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_configuration.py index fb9efc2e7956..8b9f3ad1de65 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_configuration.py @@ -12,11 +12,12 @@ 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 -VERSION = "unknown" class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. @@ -33,14 +34,9 @@ class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too :paramtype api_version: str """ - def __init__( - self, - credential: "TokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2022-07-02-preview") # type: str + api_version = kwargs.pop("api_version", "2022-07-02-preview") # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -50,23 +46,24 @@ def __init__( 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.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".format(VERSION)) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> 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.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**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.authentication_policy = kwargs.get('authentication_policy') + 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.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**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.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_container_service_client.py index da490d69fdf5..ef32874694b2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_container_service_client.py @@ -15,12 +15,27 @@ from . import models from .._serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration -from .operations import AgentPoolsOperations, FleetMembersOperations, FleetsOperations, MaintenanceConfigurationsOperations, ManagedClusterSnapshotsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations, TrustedAccessRoleBindingsOperations, TrustedAccessRolesOperations +from .operations import ( + AgentPoolsOperations, + FleetMembersOperations, + FleetsOperations, + MaintenanceConfigurationsOperations, + ManagedClusterSnapshotsOperations, + ManagedClustersOperations, + 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. @@ -81,25 +96,23 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **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 - ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( self._client, self._config, self._serialize, self._deserialize ) self.maintenance_configurations = MaintenanceConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -109,9 +122,7 @@ def __init__( self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( self._client, self._config, self._serialize, self._deserialize ) - self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -121,19 +132,10 @@ def __init__( self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.fleets = FleetsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.fleet_members = FleetMembersOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.fleets = FleetsOperations(self._client, self._config, self._serialize, self._deserialize) + self.fleet_members = FleetMembersOperations(self._client, self._config, self._serialize, self._deserialize) - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> HttpResponse: + def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_vendor.py index 138f663c53a4..9aad73fc743e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_vendor.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/_vendor.py @@ -7,6 +7,7 @@ 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) @@ -14,6 +15,7 @@ def _convert_request(request, files=None): request.set_formdata_body(files) return request + def _format_url_section(template, **kwargs): components = template.split("/") while components: @@ -21,7 +23,5 @@ def _format_url_section(template, **kwargs): return template.format(**kwargs) except KeyError as key: formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_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/v2022_07_02_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/__init__.py index 37a5f9e02e6f..a8716d29afe8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/__init__.py @@ -14,7 +14,8 @@ except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk -__all__ = ['ContainerServiceClient'] + +__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/v2022_07_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_configuration.py index 9610fd9c9025..cd4304071b1b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_configuration.py @@ -12,11 +12,12 @@ 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 -VERSION = "unknown" class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ContainerServiceClient. @@ -33,14 +34,9 @@ class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too :paramtype api_version: str """ - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ContainerServiceClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2022-07-02-preview") # type: str + api_version = kwargs.pop("api_version", "2022-07-02-preview") # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -50,22 +46,21 @@ def __init__( 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.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".format(VERSION)) 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.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**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.authentication_policy = kwargs.get('authentication_policy') + 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.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**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.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_container_service_client.py index 10612159d9e3..715c36f98c1e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_container_service_client.py @@ -15,12 +15,27 @@ from .. import models from ..._serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration -from .operations import AgentPoolsOperations, FleetMembersOperations, FleetsOperations, MaintenanceConfigurationsOperations, ManagedClusterSnapshotsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations, TrustedAccessRoleBindingsOperations, TrustedAccessRolesOperations +from .operations import ( + AgentPoolsOperations, + FleetMembersOperations, + FleetsOperations, + MaintenanceConfigurationsOperations, + ManagedClusterSnapshotsOperations, + ManagedClustersOperations, + 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. @@ -82,25 +97,23 @@ def __init__( base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._config = ContainerServiceClientConfiguration( + credential=credential, subscription_id=subscription_id, **kwargs + ) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **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 - ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( self._client, self._config, self._serialize, self._deserialize ) self.maintenance_configurations = MaintenanceConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.agent_pools = AgentPoolsOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -110,9 +123,7 @@ def __init__( self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( self._client, self._config, self._serialize, self._deserialize ) - self.snapshots = SnapshotsOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -122,19 +133,10 @@ def __init__( self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.fleets = FleetsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.fleet_members = FleetMembersOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.fleets = FleetsOperations(self._client, self._config, self._serialize, self._deserialize) + self.fleet_members = FleetMembersOperations(self._client, self._config, self._serialize, self._deserialize) - - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: + def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_patch.py index 0ad201a8c586..f7dd32510333 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/_patch.py @@ -10,6 +10,7 @@ __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. diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/__init__.py index 03d015afec25..d0dc4a5de18e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/__init__.py @@ -23,20 +23,21 @@ from ._patch import __all__ as _patch_all from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'ManagedClustersOperations', - 'MaintenanceConfigurationsOperations', - 'AgentPoolsOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ResolvePrivateLinkServiceIdOperations', - 'SnapshotsOperations', - 'ManagedClusterSnapshotsOperations', - 'TrustedAccessRolesOperations', - 'TrustedAccessRoleBindingsOperations', - 'FleetsOperations', - 'FleetMembersOperations', + "Operations", + "ManagedClustersOperations", + "MaintenanceConfigurationsOperations", + "AgentPoolsOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "SnapshotsOperations", + "ManagedClusterSnapshotsOperations", + "TrustedAccessRolesOperations", + "TrustedAccessRoleBindingsOperations", + "FleetsOperations", + "FleetMembersOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() \ No newline at end of file +_patch_sdk() 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 78b7d42e3a67..caec0d38b746 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 @@ -10,7 +10,14 @@ from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -23,10 +30,21 @@ 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_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 -T = TypeVar('T') +from ...operations._agent_pools_operations import ( + build_abort_latest_operation_request, + build_create_or_update_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, +) + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class AgentPoolsOperations: """ .. warning:: @@ -46,14 +64,9 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async async def abort_latest_operation( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: """Aborts last operation running on agent pool. @@ -76,24 +89,26 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.abort_latest_operation.metadata['url'], + template_url=self.abort_latest_operation.metadata["url"], headers=_headers, params=_params, ) @@ -101,9 +116,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -115,16 +128,10 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - abort_latest_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort"} # type: ignore - + abort_latest_operation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort"} # type: ignore @distributed_trace - def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.AgentPool"]: + 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. @@ -143,22 +150,26 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPoolListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -187,9 +198,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -199,19 +208,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> _models.AgentPool: """Gets the specified managed cluster agent pool. @@ -230,24 +233,26 @@ async def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPool] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] - 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, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -255,9 +260,7 @@ async def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -266,15 +269,14 @@ async def get( 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) + deserialized = self._deserialize("AgentPool", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore async def _create_or_update_initial( self, @@ -285,16 +287,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> _models.AgentPool: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPool] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] content_type = content_type or "application/json" _json = None @@ -302,7 +307,7 @@ async def _create_or_update_initial( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'AgentPool') + _json = self._serialize.body(parameters, "AgentPool") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -313,7 +318,7 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) @@ -321,9 +326,7 @@ async def _create_or_update_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -333,18 +336,17 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('AgentPool', pipeline_response) + deserialized = self._deserialize("AgentPool", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('AgentPool', pipeline_response) + deserialized = self._deserialize("AgentPool", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore @overload async def begin_create_or_update( @@ -430,7 +432,6 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def begin_create_or_update( self, @@ -474,15 +475,12 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPool] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( # type: ignore resource_group_name=resource_group_name, @@ -491,39 +489,35 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AgentPool', pipeline_response) + deserialized = self._deserialize("AgentPool", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -534,17 +528,19 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( resource_group_name=resource_group_name, resource_name=resource_name, @@ -552,7 +548,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements subscription_id=self._config.subscription_id, ignore_pod_disruption_budget=ignore_pod_disruption_budget, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) @@ -560,9 +556,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -574,8 +568,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -615,14 +608,11 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -630,45 +620,37 @@ async def begin_delete( agent_pool_name=agent_pool_name, ignore_pod_disruption_budget=ignore_pod_disruption_budget, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore @distributed_trace_async async def get_upgrade_profile( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> _models.AgentPoolUpgradeProfile: """Gets the upgrade profile for an agent pool. @@ -687,24 +669,26 @@ async def get_upgrade_profile( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPoolUpgradeProfile] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolUpgradeProfile] - 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, - template_url=self.get_upgrade_profile.metadata['url'], + template_url=self.get_upgrade_profile.metadata["url"], headers=_headers, params=_params, ) @@ -712,9 +696,7 @@ async def get_upgrade_profile( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -723,22 +705,18 @@ async def get_upgrade_profile( 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) + deserialized = self._deserialize("AgentPoolUpgradeProfile", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_upgrade_profile.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default"} # type: ignore - + get_upgrade_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default"} # type: ignore @distributed_trace_async async def get_available_agent_pool_versions( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> _models.AgentPoolAvailableVersions: """Gets a list of supported Kubernetes versions for the specified agent pool. @@ -757,23 +735,25 @@ async def get_available_agent_pool_versions( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPoolAvailableVersions] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolAvailableVersions] - 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, - template_url=self.get_available_agent_pool_versions.metadata['url'], + template_url=self.get_available_agent_pool_versions.metadata["url"], headers=_headers, params=_params, ) @@ -781,9 +761,7 @@ async def get_available_agent_pool_versions( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -792,42 +770,39 @@ async def get_available_agent_pool_versions( 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) + deserialized = self._deserialize("AgentPoolAvailableVersions", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_available_agent_pool_versions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions"} # type: ignore - + get_available_agent_pool_versions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions"} # type: ignore async def _upgrade_node_image_version_initial( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.AgentPool]] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AgentPool]] - 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, - template_url=self._upgrade_node_image_version_initial.metadata['url'], + template_url=self._upgrade_node_image_version_initial.metadata["url"], headers=_headers, params=_params, ) @@ -835,9 +810,7 @@ async def _upgrade_node_image_version_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -849,25 +822,22 @@ async def _upgrade_node_image_version_initial( 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) + 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) return deserialized - _upgrade_node_image_version_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # type: ignore - + _upgrade_node_image_version_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # 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 + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Upgrades the node image version of an agent pool to the latest. @@ -899,54 +869,49 @@ async def begin_upgrade_node_image_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._upgrade_node_image_version_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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + 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) + 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) return deserialized - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_upgrade_node_image_version.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # type: ignore + begin_upgrade_node_image_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # type: ignore 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 797dc3e3b77e..e6a94937850f 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 @@ -10,7 +10,14 @@ from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -23,10 +30,17 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._fleet_members_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_fleet_request -T = TypeVar('T') +from ...operations._fleet_members_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_fleet_request, +) + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class FleetMembersOperations: """ .. warning:: @@ -46,7 +60,6 @@ def __init__(self, *args, **kwargs) -> None: 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") - async def _create_or_update_initial( self, resource_group_name: str, @@ -58,16 +71,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> _models.FleetMember: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetMember] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetMember] content_type = content_type or "application/json" _json = None @@ -75,7 +91,7 @@ async def _create_or_update_initial( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'FleetMember') + _json = self._serialize.body(parameters, "FleetMember") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -88,7 +104,7 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) @@ -96,9 +112,7 @@ async def _create_or_update_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -109,18 +123,17 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('FleetMember', pipeline_response) + deserialized = self._deserialize("FleetMember", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('FleetMember', pipeline_response) + deserialized = self._deserialize("FleetMember", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore @overload async def begin_create_or_update( @@ -228,7 +241,6 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def begin_create_or_update( self, @@ -283,15 +295,12 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetMember] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetMember] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( # type: ignore resource_group_name=resource_group_name, @@ -302,47 +311,39 @@ async def begin_create_or_update( if_none_match=if_none_match, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('FleetMember', pipeline_response) + deserialized = self._deserialize("FleetMember", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - fleet_name: str, - fleet_member_name: str, - **kwargs: Any + self, resource_group_name: str, fleet_name: str, fleet_member_name: str, **kwargs: Any ) -> _models.FleetMember: """Gets a Fleet member. @@ -361,24 +362,26 @@ async def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetMember] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetMember] - request = build_get_request( resource_group_name=resource_group_name, fleet_name=fleet_name, fleet_member_name=fleet_member_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -386,9 +389,7 @@ async def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -398,15 +399,14 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('FleetMember', pipeline_response) + deserialized = self._deserialize("FleetMember", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -417,17 +417,19 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( resource_group_name=resource_group_name, fleet_name=fleet_name, @@ -435,7 +437,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) @@ -443,9 +445,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -458,8 +458,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -501,14 +500,11 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -516,44 +512,39 @@ async def begin_delete( fleet_member_name=fleet_member_name, if_match=if_match, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - lro_options={'final-state-via': 'location'}, - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore @distributed_trace def list_by_fleet( - self, - resource_group_name: str, - fleet_name: str, - **kwargs: Any + self, resource_group_name: str, fleet_name: str, **kwargs: Any ) -> AsyncIterable["_models.FleetMember"]: """Lists the members of a fleet. @@ -573,22 +564,26 @@ def list_by_fleet( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetMembersListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetMembersListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_fleet_request( resource_group_name=resource_group_name, fleet_name=fleet_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_fleet.metadata['url'], + template_url=self.list_by_fleet.metadata["url"], headers=_headers, params=_params, ) @@ -617,9 +612,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -630,8 +623,6 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_fleet.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members"} # type: ignore + list_by_fleet.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members"} # type: ignore 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 6f430b3f838a..6ce261e0eb16 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 @@ -10,7 +10,14 @@ from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -23,10 +30,20 @@ from ... import models as _models from ..._vendor import _convert_request -from ...operations._fleets_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_by_resource_group_request, build_list_credentials_request, build_list_request, build_update_request -T = TypeVar('T') +from ...operations._fleets_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_resource_group_request, + build_list_credentials_request, + build_list_request, + build_update_request, +) + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class FleetsOperations: """ .. warning:: @@ -46,7 +63,6 @@ def __init__(self, *args, **kwargs) -> None: 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") - async def _create_or_update_initial( self, resource_group_name: str, @@ -57,16 +73,19 @@ async def _create_or_update_initial( **kwargs: Any ) -> _models.Fleet: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.Fleet] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Fleet] content_type = content_type or "application/json" _json = None @@ -74,7 +93,7 @@ async def _create_or_update_initial( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'Fleet') + _json = self._serialize.body(parameters, "Fleet") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -86,7 +105,7 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) @@ -94,9 +113,7 @@ async def _create_or_update_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -107,18 +124,17 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('Fleet', pipeline_response) + deserialized = self._deserialize("Fleet", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Fleet', pipeline_response) + deserialized = self._deserialize("Fleet", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore @overload async def begin_create_or_update( @@ -216,7 +232,6 @@ async def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def begin_create_or_update( self, @@ -266,15 +281,12 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.Fleet] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Fleet] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( # type: ignore resource_group_name=resource_group_name, @@ -284,39 +296,35 @@ async def begin_create_or_update( if_none_match=if_none_match, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Fleet', pipeline_response) + deserialized = self._deserialize("Fleet", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore @overload async def update( @@ -388,7 +396,6 @@ async def update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def update( self, @@ -423,16 +430,19 @@ async def update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.Fleet] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Fleet] content_type = content_type or "application/json" _json = None @@ -441,7 +451,7 @@ async def update( _content = parameters else: if parameters is not None: - _json = self._serialize.body(parameters, 'FleetPatch') + _json = self._serialize.body(parameters, "FleetPatch") else: _json = None @@ -454,7 +464,7 @@ async def update( content_type=content_type, json=_json, content=_content, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], headers=_headers, params=_params, ) @@ -462,9 +472,7 @@ async def update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -474,23 +482,17 @@ async def update( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('Fleet', pipeline_response) + deserialized = self._deserialize("Fleet", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore @distributed_trace_async - async def get( - self, - resource_group_name: str, - fleet_name: str, - **kwargs: Any - ) -> _models.Fleet: + async def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _models.Fleet: """Gets a Fleet. Gets a Fleet. @@ -506,23 +508,25 @@ async def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.Fleet] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.Fleet] - request = build_get_request( resource_group_name=resource_group_name, fleet_name=fleet_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -530,9 +534,7 @@ async def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -542,42 +544,39 @@ async def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('Fleet', pipeline_response) + deserialized = self._deserialize("Fleet", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - fleet_name: str, - if_match: Optional[str] = None, - **kwargs: Any + self, resource_group_name: str, fleet_name: str, if_match: Optional[str] = None, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( resource_group_name=resource_group_name, fleet_name=fleet_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) @@ -585,9 +584,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -600,16 +597,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore @distributed_trace_async async def begin_delete( - self, - resource_group_name: str, - fleet_name: str, - if_match: Optional[str] = None, - **kwargs: Any + self, resource_group_name: str, fleet_name: str, if_match: Optional[str] = None, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a Fleet. @@ -639,58 +631,49 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._delete_initial( # type: ignore resource_group_name=resource_group_name, fleet_name=fleet_name, if_match=if_match, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - lro_options={'final-state-via': 'location'}, - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.Fleet"]: + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: """Lists fleets in the specified subscription and resource group. Lists fleets in the specified subscription and resource group. @@ -707,21 +690,25 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) @@ -750,9 +737,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -763,17 +748,12 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets"} # type: ignore @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.Fleet"]: + def list(self, **kwargs: Any) -> AsyncIterable["_models.Fleet"]: """Lists fleets in the specified subscription. Lists fleets in the specified subscription. @@ -787,20 +767,24 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -829,9 +813,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -842,18 +824,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets"} # type: ignore @distributed_trace_async async def list_credentials( - self, - resource_group_name: str, - fleet_name: str, - **kwargs: Any + self, resource_group_name: str, fleet_name: str, **kwargs: Any ) -> _models.FleetCredentialResults: """Lists the user credentials of a Fleet. @@ -870,23 +847,25 @@ async def list_credentials( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetCredentialResults] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetCredentialResults] - request = build_list_credentials_request( resource_group_name=resource_group_name, fleet_name=fleet_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_credentials.metadata['url'], + template_url=self.list_credentials.metadata["url"], headers=_headers, params=_params, ) @@ -894,9 +873,7 @@ async def list_credentials( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -906,12 +883,11 @@ async def list_credentials( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('FleetCredentialResults', pipeline_response) + deserialized = self._deserialize("FleetCredentialResults", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_credentials.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials"} # type: ignore - + list_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials"} # type: ignore 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 8f82066f2cfb..16e4ea8f0396 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 @@ -10,7 +10,14 @@ from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,10 +28,17 @@ 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 -T = TypeVar('T') +from ...operations._maintenance_configurations_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_by_managed_cluster_request, +) + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class MaintenanceConfigurationsOperations: """ .. warning:: @@ -44,13 +58,9 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def list_by_managed_cluster( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.MaintenanceConfiguration"]: """Gets a list of maintenance configurations in the specified managed cluster. @@ -71,22 +81,26 @@ def list_by_managed_cluster( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.MaintenanceConfigurationListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_by_managed_cluster.metadata['url'], + template_url=self.list_by_managed_cluster.metadata["url"], headers=_headers, params=_params, ) @@ -115,9 +129,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -127,19 +139,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_managed_cluster.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations"} # type: ignore + list_by_managed_cluster.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - resource_name: str, - config_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any ) -> _models.MaintenanceConfiguration: """Gets the specified maintenance configuration of a managed cluster. @@ -158,24 +164,26 @@ async def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.MaintenanceConfiguration] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfiguration] - 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, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -183,9 +191,7 @@ async def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -194,15 +200,14 @@ async def get( 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) + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore @overload async def create_or_update( @@ -271,7 +276,6 @@ async def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def create_or_update( self, @@ -305,16 +309,19 @@ async def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.MaintenanceConfiguration] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfiguration] content_type = content_type or "application/json" _json = None @@ -322,7 +329,7 @@ async def create_or_update( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + _json = self._serialize.body(parameters, "MaintenanceConfiguration") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -333,7 +340,7 @@ async def create_or_update( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], headers=_headers, params=_params, ) @@ -341,9 +348,7 @@ async def create_or_update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -352,23 +357,18 @@ async def create_or_update( 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) + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # 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 + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any ) -> None: """Deletes a maintenance configuration. @@ -387,24 +387,26 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], headers=_headers, params=_params, ) @@ -412,9 +414,7 @@ async def delete( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -426,5 +426,4 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore 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 dc8a2ef0c3a9..b0e051d2420f 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 @@ -10,7 +10,14 @@ from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,10 +28,19 @@ 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 -T = TypeVar('T') +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, +) + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class ManagedClusterSnapshotsOperations: """ .. warning:: @@ -44,12 +60,8 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.ManagedClusterSnapshot"]: + 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. @@ -64,20 +76,24 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterSnapshotListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -106,9 +122,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -118,17 +132,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any + self, resource_group_name: str, **kwargs: Any ) -> AsyncIterable["_models.ManagedClusterSnapshot"]: """Lists managed cluster snapshots in the specified subscription and resource group. @@ -147,21 +157,25 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterSnapshotListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) @@ -190,9 +204,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -202,19 +214,12 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore @distributed_trace_async - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: + 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. @@ -230,23 +235,25 @@ async def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterSnapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] - request = build_get_request( resource_group_name=resource_group_name, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -254,9 +261,7 @@ async def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -265,15 +270,14 @@ async def get( 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) + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore @overload async def create_or_update( @@ -336,7 +340,6 @@ async def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def create_or_update( self, @@ -367,16 +370,19 @@ async def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterSnapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] content_type = content_type or "application/json" _json = None @@ -384,7 +390,7 @@ async def create_or_update( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'ManagedClusterSnapshot') + _json = self._serialize.body(parameters, "ManagedClusterSnapshot") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -394,7 +400,7 @@ async def create_or_update( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], headers=_headers, params=_params, ) @@ -402,9 +408,7 @@ async def create_or_update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -414,18 +418,17 @@ async def create_or_update( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('ManagedClusterSnapshot', pipeline_response) + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ManagedClusterSnapshot', pipeline_response) + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore @overload async def update_tags( @@ -489,14 +492,9 @@ async def update_tags( :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], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedClusterSnapshot: """Updates tags on a managed cluster snapshot. @@ -519,16 +517,19 @@ async def update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterSnapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] content_type = content_type or "application/json" _json = None @@ -536,7 +537,7 @@ async def update_tags( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'TagsObject') + _json = self._serialize.body(parameters, "TagsObject") request = build_update_tags_request( resource_group_name=resource_group_name, @@ -546,7 +547,7 @@ async def update_tags( content_type=content_type, json=_json, content=_content, - template_url=self.update_tags.metadata['url'], + template_url=self.update_tags.metadata["url"], headers=_headers, params=_params, ) @@ -554,9 +555,7 @@ async def update_tags( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -565,22 +564,18 @@ async def update_tags( 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) + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore - + update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: """Deletes a managed cluster snapshot. @@ -597,23 +592,25 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], headers=_headers, params=_params, ) @@ -621,9 +618,7 @@ async def delete( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -635,5 +630,4 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore 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 3d4f4b1cda24..369a55d0f533 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 @@ -10,7 +10,14 @@ from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -23,10 +30,35 @@ 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_os_options_request, build_get_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_outbound_network_dependencies_endpoints_request, build_list_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 -T = TypeVar('T') +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_os_options_request, + build_get_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_outbound_network_dependencies_endpoints_request, + build_list_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, +) + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class ManagedClustersOperations: # pylint: disable=too-many-public-methods """ .. warning:: @@ -46,13 +78,9 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async async def get_os_options( - self, - location: str, - resource_type: Optional[str] = None, - **kwargs: Any + self, location: str, resource_type: Optional[str] = None, **kwargs: Any ) -> _models.OSOptionProfile: """Gets supported OS options in the specified subscription. @@ -69,23 +97,25 @@ async def get_os_options( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.OSOptionProfile] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OSOptionProfile] - request = build_get_os_options_request( location=location, subscription_id=self._config.subscription_id, resource_type=resource_type, api_version=api_version, - template_url=self.get_os_options.metadata['url'], + template_url=self.get_os_options.metadata["url"], headers=_headers, params=_params, ) @@ -93,9 +123,7 @@ async def get_os_options( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -104,21 +132,17 @@ async def get_os_options( 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) + deserialized = self._deserialize("OSOptionProfile", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_os_options.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default"} # type: ignore - + get_os_options.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default"} # type: ignore @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.ManagedCluster"]: + 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. @@ -132,20 +156,24 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -174,9 +202,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -186,17 +212,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any + self, resource_group_name: str, **kwargs: Any ) -> AsyncIterable["_models.ManagedCluster"]: """Lists managed clusters in the specified subscription and resource group. @@ -214,21 +236,25 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) @@ -257,9 +283,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -269,18 +293,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore @distributed_trace_async async def get_upgrade_profile( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> _models.ManagedClusterUpgradeProfile: """Gets the upgrade profile of a managed cluster. @@ -297,23 +316,25 @@ async def get_upgrade_profile( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterUpgradeProfile] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterUpgradeProfile] - 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, - template_url=self.get_upgrade_profile.metadata['url'], + template_url=self.get_upgrade_profile.metadata["url"], headers=_headers, params=_params, ) @@ -321,9 +342,7 @@ async def get_upgrade_profile( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -332,23 +351,18 @@ async def get_upgrade_profile( 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) + deserialized = self._deserialize("ManagedClusterUpgradeProfile", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_upgrade_profile.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default"} # type: ignore - + get_upgrade_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default"} # type: ignore @distributed_trace_async async def get_access_profile( - self, - resource_group_name: str, - resource_name: str, - role_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. @@ -370,24 +384,26 @@ async def get_access_profile( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterAccessProfile] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterAccessProfile] - 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, - template_url=self.get_access_profile.metadata['url'], + template_url=self.get_access_profile.metadata["url"], headers=_headers, params=_params, ) @@ -395,9 +411,7 @@ async def get_access_profile( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -406,23 +420,18 @@ async def get_access_profile( 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) + deserialized = self._deserialize("ManagedClusterAccessProfile", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_access_profile.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential"} # type: ignore - + get_access_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential"} # 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 + 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. @@ -441,24 +450,26 @@ async def list_cluster_admin_credentials( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.CredentialResults] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] - 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, - template_url=self.list_cluster_admin_credentials.metadata['url'], + template_url=self.list_cluster_admin_credentials.metadata["url"], headers=_headers, params=_params, ) @@ -466,9 +477,7 @@ async def list_cluster_admin_credentials( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -477,15 +486,14 @@ async def list_cluster_admin_credentials( 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) + deserialized = self._deserialize("CredentialResults", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_cluster_admin_credentials.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential"} # type: ignore - + list_cluster_admin_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential"} # type: ignore @distributed_trace_async async def list_cluster_user_credentials( @@ -518,17 +526,19 @@ async def list_cluster_user_credentials( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.CredentialResults] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] - request = build_list_cluster_user_credentials_request( resource_group_name=resource_group_name, resource_name=resource_name, @@ -536,7 +546,7 @@ async def list_cluster_user_credentials( server_fqdn=server_fqdn, format=format, api_version=api_version, - template_url=self.list_cluster_user_credentials.metadata['url'], + template_url=self.list_cluster_user_credentials.metadata["url"], headers=_headers, params=_params, ) @@ -544,9 +554,7 @@ async def list_cluster_user_credentials( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -555,23 +563,18 @@ async def list_cluster_user_credentials( 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) + deserialized = self._deserialize("CredentialResults", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_cluster_user_credentials.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential"} # type: ignore - + list_cluster_user_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential"} # 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 + 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. @@ -590,24 +593,26 @@ async def list_cluster_monitoring_user_credentials( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.CredentialResults] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] - 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, - template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + template_url=self.list_cluster_monitoring_user_credentials.metadata["url"], headers=_headers, params=_params, ) @@ -615,9 +620,7 @@ async def list_cluster_monitoring_user_credentials( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -626,23 +629,17 @@ async def list_cluster_monitoring_user_credentials( 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) + deserialized = self._deserialize("CredentialResults", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_cluster_monitoring_user_credentials.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential"} # type: ignore - + list_cluster_monitoring_user_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential"} # type: ignore @distributed_trace_async - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> _models.ManagedCluster: + async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: """Gets a managed cluster. Gets a managed cluster. @@ -658,23 +655,25 @@ async def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedCluster] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] - request = build_get_request( resource_group_name=resource_group_name, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -682,9 +681,7 @@ async def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -693,34 +690,32 @@ async def get( 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) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore async def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedCluster, IO], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedCluster] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] content_type = content_type or "application/json" _json = None @@ -728,7 +723,7 @@ async def _create_or_update_initial( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'ManagedCluster') + _json = self._serialize.body(parameters, "ManagedCluster") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -738,7 +733,7 @@ async def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) @@ -746,9 +741,7 @@ async def _create_or_update_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -758,18 +751,17 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', pipeline_response) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', pipeline_response) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore @overload async def begin_create_or_update( @@ -849,14 +841,9 @@ async def begin_create_or_update( :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], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> AsyncLROPoller[_models.ManagedCluster]: """Creates or updates a managed cluster. @@ -890,15 +877,12 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedCluster] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._create_or_update_initial( # type: ignore resource_group_name=resource_group_name, @@ -906,58 +890,53 @@ async def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ManagedCluster', pipeline_response) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore async def _update_tags_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedCluster] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] content_type = content_type or "application/json" _json = None @@ -965,7 +944,7 @@ async def _update_tags_initial( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'TagsObject') + _json = self._serialize.body(parameters, "TagsObject") request = build_update_tags_request( resource_group_name=resource_group_name, @@ -975,7 +954,7 @@ async def _update_tags_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_tags_initial.metadata['url'], + template_url=self._update_tags_initial.metadata["url"], headers=_headers, params=_params, ) @@ -983,9 +962,7 @@ async def _update_tags_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -994,15 +971,14 @@ async def _update_tags_initial( 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) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_tags_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore - + _update_tags_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore @overload async def begin_update_tags( @@ -1082,14 +1058,9 @@ async def begin_update_tags( :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], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> AsyncLROPoller[_models.ManagedCluster]: """Updates tags on a managed cluster. @@ -1123,15 +1094,12 @@ async def begin_update_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedCluster] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._update_tags_initial( # type: ignore resource_group_name=resource_group_name, @@ -1139,39 +1107,35 @@ async def begin_update_tags( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ManagedCluster', pipeline_response) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore + begin_update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore async def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -1181,24 +1145,26 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1206,9 +1172,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1220,8 +1184,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore @distributed_trace_async async def begin_delete( @@ -1258,51 +1221,44 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore async def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-return-statements self, @@ -1312,16 +1268,19 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] content_type = content_type or "application/json" _json = None @@ -1329,7 +1288,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + _json = self._serialize.body(parameters, "ManagedClusterServicePrincipalProfile") request = build_reset_service_principal_profile_request( resource_group_name=resource_group_name, @@ -1339,7 +1298,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist content_type=content_type, json=_json, content=_content, - template_url=self._reset_service_principal_profile_initial.metadata['url'], + template_url=self._reset_service_principal_profile_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1347,9 +1306,7 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1358,11 +1315,14 @@ async def _reset_service_principal_profile_initial( # pylint: disable=inconsist 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _reset_service_principal_profile_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _reset_service_principal_profile_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # type: ignore @overload async def begin_reset_service_principal_profile( @@ -1439,7 +1399,6 @@ async def begin_reset_service_principal_profile( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def begin_reset_service_principal_profile( self, @@ -1480,15 +1439,12 @@ async def begin_reset_service_principal_profile( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._reset_service_principal_profile_initial( # type: ignore resource_group_name=resource_group_name, @@ -1496,37 +1452,33 @@ async def begin_reset_service_principal_profile( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_reset_service_principal_profile.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # type: ignore + begin_reset_service_principal_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # type: ignore async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statements self, @@ -1536,16 +1488,19 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] content_type = content_type or "application/json" _json = None @@ -1553,7 +1508,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + _json = self._serialize.body(parameters, "ManagedClusterAADProfile") request = build_reset_aad_profile_request( resource_group_name=resource_group_name, @@ -1563,7 +1518,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta content_type=content_type, json=_json, content=_content, - template_url=self._reset_aad_profile_initial.metadata['url'], + template_url=self._reset_aad_profile_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1571,9 +1526,7 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1582,11 +1535,14 @@ async def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-sta 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _reset_aad_profile_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _reset_aad_profile_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # type: ignore @overload async def begin_reset_aad_profile( @@ -1663,7 +1619,6 @@ async def begin_reset_aad_profile( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def begin_reset_aad_profile( self, @@ -1703,15 +1658,12 @@ async def begin_reset_aad_profile( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._reset_aad_profile_initial( # type: ignore resource_group_name=resource_group_name, @@ -1719,44 +1671,37 @@ async def begin_reset_aad_profile( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_reset_aad_profile.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # type: ignore + begin_reset_aad_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # type: ignore @distributed_trace_async async def abort_latest_operation( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: """Aborts last operation running on managed cluster. @@ -1777,23 +1722,25 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.abort_latest_operation.metadata['url'], + template_url=self.abort_latest_operation.metadata["url"], headers=_headers, params=_params, ) @@ -1801,9 +1748,7 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1815,33 +1760,31 @@ async def abort_latest_operation( # pylint: disable=inconsistent-return-stateme if cls: return cls(pipeline_response, None, {}) - abort_latest_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort"} # type: ignore - + abort_latest_operation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort"} # type: ignore async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._rotate_cluster_certificates_initial.metadata['url'], + template_url=self._rotate_cluster_certificates_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1849,9 +1792,7 @@ async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent- request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1860,18 +1801,18 @@ async def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent- 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _rotate_cluster_certificates_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _rotate_cluster_certificates_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # type: ignore @distributed_trace_async async def begin_rotate_cluster_certificates( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Rotates the certificates of a managed cluster. @@ -1898,75 +1839,67 @@ async def begin_rotate_cluster_certificates( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_rotate_cluster_certificates.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # type: ignore + begin_rotate_cluster_certificates.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # type: ignore async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._rotate_service_account_signing_keys_initial.metadata['url'], + template_url=self._rotate_service_account_signing_keys_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1974,9 +1907,7 @@ async def _rotate_service_account_signing_keys_initial( # pylint: disable=incon request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1985,18 +1916,18 @@ async def _rotate_service_account_signing_keys_initial( # pylint: disable=incon 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _rotate_service_account_signing_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _rotate_service_account_signing_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore @distributed_trace_async async def begin_rotate_service_account_signing_keys( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Rotates the service account signing keys of a managed cluster. @@ -2022,75 +1953,67 @@ async def begin_rotate_service_account_signing_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_rotate_service_account_signing_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore + begin_rotate_service_account_signing_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore async def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2098,9 +2021,7 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2109,19 +2030,17 @@ async def _stop_initial( # pylint: disable=inconsistent-return-statements 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # type: ignore @distributed_trace_async - async def begin_stop( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: + 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 @@ -2150,75 +2069,67 @@ async def begin_stop( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # type: ignore async def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2226,9 +2137,7 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2237,19 +2146,17 @@ async def _start_initial( # pylint: disable=inconsistent-return-statements 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # type: ignore @distributed_trace_async - async def begin_start( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: + 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 @@ -2275,50 +2182,43 @@ async def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # type: ignore async def _run_command_initial( self, @@ -2328,16 +2228,19 @@ async def _run_command_initial( **kwargs: Any ) -> Optional[_models.RunCommandResult]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.RunCommandResult]] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] content_type = content_type or "application/json" _json = None @@ -2345,7 +2248,7 @@ async def _run_command_initial( if isinstance(request_payload, (IO, bytes)): _content = request_payload else: - _json = self._serialize.body(request_payload, 'RunCommandRequest') + _json = self._serialize.body(request_payload, "RunCommandRequest") request = build_run_command_request( resource_group_name=resource_group_name, @@ -2355,7 +2258,7 @@ async def _run_command_initial( content_type=content_type, json=_json, content=_content, - template_url=self._run_command_initial.metadata['url'], + template_url=self._run_command_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2363,9 +2266,7 @@ async def _run_command_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2375,16 +2276,19 @@ async def _run_command_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('RunCommandResult', pipeline_response) + 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, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _run_command_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # type: ignore - + _run_command_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # type: ignore @overload async def begin_run_command( @@ -2469,7 +2373,6 @@ async def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def begin_run_command( self, @@ -2512,15 +2415,12 @@ async def begin_run_command( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.RunCommandResult] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = await self._run_command_initial( # type: ignore resource_group_name=resource_group_name, @@ -2528,47 +2428,39 @@ async def begin_run_command( request_payload=request_payload, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RunCommandResult', pipeline_response) + deserialized = self._deserialize("RunCommandResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_run_command.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # type: ignore + begin_run_command.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # type: ignore @distributed_trace_async async def get_command_result( - self, - resource_group_name: str, - resource_name: str, - command_id: str, - **kwargs: Any + 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. @@ -2587,24 +2479,26 @@ async def get_command_result( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.RunCommandResult]] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] - 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, - template_url=self.get_command_result.metadata['url'], + template_url=self.get_command_result.metadata["url"], headers=_headers, params=_params, ) @@ -2612,9 +2506,7 @@ async def get_command_result( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2625,22 +2517,18 @@ async def get_command_result( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('RunCommandResult', pipeline_response) + deserialized = self._deserialize("RunCommandResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_command_result.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}"} # type: ignore - + get_command_result.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + 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. @@ -2663,22 +2551,26 @@ def list_outbound_network_dependencies_endpoints( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata["url"], headers=_headers, params=_params, ) @@ -2707,9 +2599,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2719,8 +2609,6 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints"} # type: ignore + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints"} # type: ignore 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 6c82269e5d5f..25c1e0845f71 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 @@ -10,7 +10,14 @@ from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,9 +28,11 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._operations import build_list_request -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class Operations: """ .. warning:: @@ -43,12 +52,8 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.OperationValue"]: + def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: """Gets a list of operations. Gets a list of operations. @@ -62,19 +67,23 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -103,9 +112,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -115,8 +122,6 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.ContainerService/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.ContainerService/operations"} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_patch.py index 0ad201a8c586..f7dd32510333 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/aio/operations/_patch.py @@ -10,6 +10,7 @@ __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. 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 8c45697b8aa0..329fc8399a1d 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 @@ -8,7 +8,14 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -20,10 +27,17 @@ 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 -T = TypeVar('T') +from ...operations._private_endpoint_connections_operations import ( + build_delete_request, + build_get_request, + build_list_request, + build_update_request, +) + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class PrivateEndpointConnectionsOperations: """ .. warning:: @@ -43,13 +57,9 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async async def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> _models.PrivateEndpointConnectionListResult: """Gets a list of private endpoint connections in the specified managed cluster. @@ -68,23 +78,25 @@ async def list( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] - request = build_list_request( resource_group_name=resource_group_name, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -92,9 +104,7 @@ async def list( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -103,23 +113,18 @@ async def list( 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) + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> _models.PrivateEndpointConnection: """Gets the specified private endpoint connection. @@ -139,24 +144,26 @@ async def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnection] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - 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, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -164,9 +171,7 @@ async def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -175,15 +180,14 @@ async def get( 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) + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @overload async def update( @@ -252,7 +256,6 @@ async def update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def update( self, @@ -286,16 +289,19 @@ async def update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnection] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] content_type = content_type or "application/json" _json = None @@ -303,7 +309,7 @@ async def update( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + _json = self._serialize.body(parameters, "PrivateEndpointConnection") request = build_update_request( resource_group_name=resource_group_name, @@ -314,7 +320,7 @@ async def update( content_type=content_type, json=_json, content=_content, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], headers=_headers, params=_params, ) @@ -322,9 +328,7 @@ async def update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -333,42 +337,39 @@ async def update( 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) + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # 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 + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) @@ -376,9 +377,7 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -390,16 +389,11 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def begin_delete( - self, - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a private endpoint connection. @@ -427,48 +421,41 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(AsyncPollingMethod, AsyncARMPolling( - lro_delay, - - - **kwargs - )) # type: AsyncPollingMethod - elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: polling_method = polling + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling if cont_token: return AsyncLROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore 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 9390b12e3edf..b2f98f2ce4bb 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 @@ -8,7 +8,14 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -19,9 +26,11 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._private_link_resources_operations import build_list_request -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class PrivateLinkResourcesOperations: """ .. warning:: @@ -41,13 +50,9 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async async def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> _models.PrivateLinkResourcesListResult: """Gets a list of private link resources in the specified managed cluster. @@ -65,23 +70,25 @@ async def list( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateLinkResourcesListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourcesListResult] - request = build_list_request( resource_group_name=resource_group_name, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -89,9 +96,7 @@ async def list( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -100,12 +105,11 @@ async def list( 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) + deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources"} # type: ignore 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 a4ebdac3933b..fdcbf939aff5 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 @@ -8,7 +8,14 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -19,9 +26,11 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._resolve_private_link_service_id_operations import build_post_request -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class ResolvePrivateLinkServiceIdOperations: """ .. warning:: @@ -41,7 +50,6 @@ def __init__(self, *args, **kwargs) -> None: 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") - @overload async def post( self, @@ -102,7 +110,6 @@ async def post( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def post( self, @@ -133,16 +140,19 @@ async def post( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateLinkResource] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResource] content_type = content_type or "application/json" _json = None @@ -150,7 +160,7 @@ async def post( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'PrivateLinkResource') + _json = self._serialize.body(parameters, "PrivateLinkResource") request = build_post_request( resource_group_name=resource_group_name, @@ -160,7 +170,7 @@ async def post( content_type=content_type, json=_json, content=_content, - template_url=self.post.metadata['url'], + template_url=self.post.metadata["url"], headers=_headers, params=_params, ) @@ -168,9 +178,7 @@ async def post( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -179,12 +187,11 @@ async def post( 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) + deserialized = self._deserialize("PrivateLinkResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - post.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId"} # type: ignore - + post.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId"} # type: ignore 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 968e32cc95d4..9762fa8975cc 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 @@ -10,7 +10,14 @@ from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,10 +28,19 @@ 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 -T = TypeVar('T') +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, +) + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class SnapshotsOperations: """ .. warning:: @@ -44,12 +60,8 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - **kwargs: Any - ) -> AsyncIterable["_models.Snapshot"]: + 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. @@ -63,20 +75,24 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -105,9 +121,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -117,18 +131,12 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots"} # type: ignore @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.Snapshot"]: + 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. @@ -145,21 +153,25 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) @@ -188,9 +200,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -200,19 +210,12 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots"} # type: ignore @distributed_trace_async - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> _models.Snapshot: + async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.Snapshot: """Gets a snapshot. Gets a snapshot. @@ -228,23 +231,25 @@ async def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - request = build_get_request( resource_group_name=resource_group_name, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -252,9 +257,7 @@ async def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -263,15 +266,14 @@ async def get( 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) + deserialized = self._deserialize("Snapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore @overload async def create_or_update( @@ -333,14 +335,9 @@ async def create_or_update( :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], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.Snapshot, IO], **kwargs: Any ) -> _models.Snapshot: """Creates or updates a snapshot. @@ -363,16 +360,19 @@ async def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] content_type = content_type or "application/json" _json = None @@ -380,7 +380,7 @@ async def create_or_update( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'Snapshot') + _json = self._serialize.body(parameters, "Snapshot") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -390,7 +390,7 @@ async def create_or_update( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], headers=_headers, params=_params, ) @@ -398,9 +398,7 @@ async def create_or_update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -410,18 +408,17 @@ async def create_or_update( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('Snapshot', pipeline_response) + deserialized = self._deserialize("Snapshot", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Snapshot', pipeline_response) + deserialized = self._deserialize("Snapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore @overload async def update_tags( @@ -483,14 +480,9 @@ async def update_tags( :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], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.Snapshot: """Updates tags on a snapshot. @@ -513,16 +505,19 @@ async def update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] content_type = content_type or "application/json" _json = None @@ -530,7 +525,7 @@ async def update_tags( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'TagsObject') + _json = self._serialize.body(parameters, "TagsObject") request = build_update_tags_request( resource_group_name=resource_group_name, @@ -540,7 +535,7 @@ async def update_tags( content_type=content_type, json=_json, content=_content, - template_url=self.update_tags.metadata['url'], + template_url=self.update_tags.metadata["url"], headers=_headers, params=_params, ) @@ -548,9 +543,7 @@ async def update_tags( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -559,22 +552,18 @@ async def update_tags( 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) + deserialized = self._deserialize("Snapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore - + update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: """Deletes a snapshot. @@ -591,23 +580,25 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], headers=_headers, params=_params, ) @@ -615,9 +606,7 @@ async def delete( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -629,5 +618,4 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore 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 6bec990759bc..6c6d07e6f249 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 @@ -10,7 +10,14 @@ from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,10 +28,17 @@ 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 -T = TypeVar('T') +from ...operations._trusted_access_role_bindings_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class TrustedAccessRoleBindingsOperations: """ .. warning:: @@ -44,13 +58,9 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> AsyncIterable["_models.TrustedAccessRoleBinding"]: """List trusted access role bindings. @@ -71,22 +81,26 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -115,9 +129,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -127,19 +139,13 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings"} # type: ignore @distributed_trace_async async def get( - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> _models.TrustedAccessRoleBinding: """Get a trusted access role binding. @@ -158,24 +164,26 @@ async def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.TrustedAccessRoleBinding] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBinding] - 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, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -183,9 +191,7 @@ async def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -194,15 +200,14 @@ async def get( 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) + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore @overload async def create_or_update( @@ -271,7 +276,6 @@ async def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace_async async def create_or_update( self, @@ -305,16 +309,19 @@ async def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.TrustedAccessRoleBinding] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBinding] content_type = content_type or "application/json" _json = None @@ -322,7 +329,7 @@ async def create_or_update( if isinstance(trusted_access_role_binding, (IO, bytes)): _content = trusted_access_role_binding else: - _json = self._serialize.body(trusted_access_role_binding, 'TrustedAccessRoleBinding') + _json = self._serialize.body(trusted_access_role_binding, "TrustedAccessRoleBinding") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -333,7 +340,7 @@ async def create_or_update( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], headers=_headers, params=_params, ) @@ -341,9 +348,7 @@ async def create_or_update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -352,23 +357,18 @@ async def create_or_update( 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) + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore @distributed_trace_async async def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: """Delete a trusted access role binding. @@ -387,24 +387,26 @@ async def delete( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], headers=_headers, params=_params, ) @@ -412,9 +414,7 @@ async def delete( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -426,5 +426,4 @@ async def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore 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 9e20411d8513..d1b633daba9d 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 @@ -10,7 +10,14 @@ from urllib.parse import parse_qs, urljoin, urlparse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,9 +28,11 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._trusted_access_roles_operations import build_list_request -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + class TrustedAccessRolesOperations: """ .. warning:: @@ -43,13 +52,8 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> AsyncIterable["_models.TrustedAccessRole"]: + def list(self, location: str, **kwargs: Any) -> AsyncIterable["_models.TrustedAccessRole"]: """List supported trusted access roles. List supported trusted access roles. @@ -65,21 +69,25 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.TrustedAccessRoleListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -108,9 +116,7 @@ async def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -120,8 +126,6 @@ async def get_next(next_link=None): return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles"} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/__init__.py index ed29664e8f26..3ea029db77d2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/__init__.py @@ -180,177 +180,178 @@ from ._patch import __all__ as _patch_all from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'AgentPool', - 'AgentPoolAvailableVersions', - 'AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem', - 'AgentPoolListResult', - 'AgentPoolUpgradeProfile', - 'AgentPoolUpgradeProfilePropertiesUpgradesItem', - 'AgentPoolUpgradeSettings', - 'AzureEntityResource', - 'AzureKeyVaultKms', - 'CloudErrorBody', - 'ContainerServiceDiagnosticsProfile', - 'ContainerServiceLinuxProfile', - 'ContainerServiceMasterProfile', - 'ContainerServiceNetworkProfile', - 'ContainerServiceSshConfiguration', - 'ContainerServiceSshPublicKey', - 'ContainerServiceVMDiagnostics', - 'CreationData', - 'CredentialResult', - 'CredentialResults', - 'EndpointDependency', - 'EndpointDetail', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'ExtendedLocation', - 'Fleet', - 'FleetCredentialResult', - 'FleetCredentialResults', - 'FleetHubProfile', - 'FleetListResult', - 'FleetMember', - 'FleetMembersListResult', - 'FleetPatch', - 'KubeletConfig', - 'LinuxOSConfig', - 'MaintenanceConfiguration', - 'MaintenanceConfigurationListResult', - 'ManagedCluster', - 'ManagedClusterAADProfile', - 'ManagedClusterAPIServerAccessProfile', - 'ManagedClusterAccessProfile', - 'ManagedClusterAddonProfile', - 'ManagedClusterAddonProfileIdentity', - 'ManagedClusterAgentPoolProfile', - 'ManagedClusterAgentPoolProfileProperties', - 'ManagedClusterAutoUpgradeProfile', - 'ManagedClusterAzureMonitorProfile', - 'ManagedClusterAzureMonitorProfileKubeStateMetrics', - 'ManagedClusterAzureMonitorProfileMetrics', - 'ManagedClusterHTTPProxyConfig', - 'ManagedClusterIdentity', - 'ManagedClusterIngressProfile', - 'ManagedClusterIngressProfileWebAppRouting', - 'ManagedClusterListResult', - 'ManagedClusterLoadBalancerProfile', - 'ManagedClusterLoadBalancerProfileManagedOutboundIPs', - 'ManagedClusterLoadBalancerProfileOutboundIPPrefixes', - 'ManagedClusterLoadBalancerProfileOutboundIPs', - 'ManagedClusterManagedOutboundIPProfile', - 'ManagedClusterNATGatewayProfile', - 'ManagedClusterOIDCIssuerProfile', - 'ManagedClusterPodIdentity', - 'ManagedClusterPodIdentityException', - 'ManagedClusterPodIdentityProfile', - 'ManagedClusterPodIdentityProvisioningError', - 'ManagedClusterPodIdentityProvisioningErrorBody', - 'ManagedClusterPodIdentityProvisioningInfo', - 'ManagedClusterPoolUpgradeProfile', - 'ManagedClusterPoolUpgradeProfileUpgradesItem', - 'ManagedClusterPropertiesAutoScalerProfile', - 'ManagedClusterPropertiesForSnapshot', - 'ManagedClusterSKU', - 'ManagedClusterSecurityProfile', - 'ManagedClusterSecurityProfileDefender', - 'ManagedClusterSecurityProfileDefenderSecurityMonitoring', - 'ManagedClusterSecurityProfileImageCleaner', - 'ManagedClusterSecurityProfileNodeRestriction', - 'ManagedClusterSecurityProfileWorkloadIdentity', - 'ManagedClusterServicePrincipalProfile', - 'ManagedClusterSnapshot', - 'ManagedClusterSnapshotListResult', - 'ManagedClusterStorageProfile', - 'ManagedClusterStorageProfileBlobCSIDriver', - 'ManagedClusterStorageProfileDiskCSIDriver', - 'ManagedClusterStorageProfileFileCSIDriver', - 'ManagedClusterStorageProfileSnapshotController', - 'ManagedClusterUpgradeProfile', - 'ManagedClusterWindowsProfile', - 'ManagedClusterWorkloadAutoScalerProfile', - 'ManagedClusterWorkloadAutoScalerProfileKeda', - 'ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler', - 'ManagedServiceIdentityUserAssignedIdentitiesValue', - 'NetworkProfileForSnapshot', - 'OSOptionProfile', - 'OSOptionProperty', - 'OperationListResult', - 'OperationValue', - 'OutboundEnvironmentEndpoint', - 'OutboundEnvironmentEndpointCollection', - 'PowerState', - 'PrivateEndpoint', - 'PrivateEndpointConnection', - 'PrivateEndpointConnectionListResult', - 'PrivateLinkResource', - 'PrivateLinkResourcesListResult', - 'PrivateLinkServiceConnectionState', - 'Resource', - 'ResourceReference', - 'RunCommandRequest', - 'RunCommandResult', - 'Snapshot', - 'SnapshotListResult', - 'SubResource', - 'SysctlConfig', - 'SystemData', - 'TagsObject', - 'TimeInWeek', - 'TimeSpan', - 'TrackedResource', - 'TrustedAccessRole', - 'TrustedAccessRoleBinding', - 'TrustedAccessRoleBindingListResult', - 'TrustedAccessRoleListResult', - 'TrustedAccessRoleRule', - 'UserAssignedIdentity', - 'WindowsGmsaProfile', - 'AgentPoolMode', - 'AgentPoolType', - 'Code', - 'ConnectionStatus', - 'ContainerServiceStorageProfileTypes', - 'ContainerServiceVMSizeTypes', - 'ControlledValues', - 'Count', - 'CreatedByType', - 'Expander', - 'ExtendedLocationTypes', - 'FleetMemberProvisioningState', - 'FleetProvisioningState', - 'Format', - 'GPUInstanceProfile', - 'IpFamily', - 'KeyVaultNetworkAccessTypes', - 'KubeletDiskType', - 'LicenseType', - 'LoadBalancerSku', - 'ManagedClusterPodIdentityProvisioningState', - 'ManagedClusterSKUName', - 'ManagedClusterSKUTier', - 'NetworkMode', - 'NetworkPlugin', - 'NetworkPluginMode', - 'NetworkPolicy', - 'OSDiskType', - 'OSSKU', - 'OSType', - 'OutboundType', - 'PrivateEndpointConnectionProvisioningState', - 'PublicNetworkAccess', - 'ResourceIdentityType', - 'ScaleDownMode', - 'ScaleSetEvictionPolicy', - 'ScaleSetPriority', - 'SnapshotType', - 'TrustedAccessRoleBindingProvisioningState', - 'UpdateMode', - 'UpgradeChannel', - 'WeekDay', - 'WorkloadRuntime', + "AgentPool", + "AgentPoolAvailableVersions", + "AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem", + "AgentPoolListResult", + "AgentPoolUpgradeProfile", + "AgentPoolUpgradeProfilePropertiesUpgradesItem", + "AgentPoolUpgradeSettings", + "AzureEntityResource", + "AzureKeyVaultKms", + "CloudErrorBody", + "ContainerServiceDiagnosticsProfile", + "ContainerServiceLinuxProfile", + "ContainerServiceMasterProfile", + "ContainerServiceNetworkProfile", + "ContainerServiceSshConfiguration", + "ContainerServiceSshPublicKey", + "ContainerServiceVMDiagnostics", + "CreationData", + "CredentialResult", + "CredentialResults", + "EndpointDependency", + "EndpointDetail", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "ExtendedLocation", + "Fleet", + "FleetCredentialResult", + "FleetCredentialResults", + "FleetHubProfile", + "FleetListResult", + "FleetMember", + "FleetMembersListResult", + "FleetPatch", + "KubeletConfig", + "LinuxOSConfig", + "MaintenanceConfiguration", + "MaintenanceConfigurationListResult", + "ManagedCluster", + "ManagedClusterAADProfile", + "ManagedClusterAPIServerAccessProfile", + "ManagedClusterAccessProfile", + "ManagedClusterAddonProfile", + "ManagedClusterAddonProfileIdentity", + "ManagedClusterAgentPoolProfile", + "ManagedClusterAgentPoolProfileProperties", + "ManagedClusterAutoUpgradeProfile", + "ManagedClusterAzureMonitorProfile", + "ManagedClusterAzureMonitorProfileKubeStateMetrics", + "ManagedClusterAzureMonitorProfileMetrics", + "ManagedClusterHTTPProxyConfig", + "ManagedClusterIdentity", + "ManagedClusterIngressProfile", + "ManagedClusterIngressProfileWebAppRouting", + "ManagedClusterListResult", + "ManagedClusterLoadBalancerProfile", + "ManagedClusterLoadBalancerProfileManagedOutboundIPs", + "ManagedClusterLoadBalancerProfileOutboundIPPrefixes", + "ManagedClusterLoadBalancerProfileOutboundIPs", + "ManagedClusterManagedOutboundIPProfile", + "ManagedClusterNATGatewayProfile", + "ManagedClusterOIDCIssuerProfile", + "ManagedClusterPodIdentity", + "ManagedClusterPodIdentityException", + "ManagedClusterPodIdentityProfile", + "ManagedClusterPodIdentityProvisioningError", + "ManagedClusterPodIdentityProvisioningErrorBody", + "ManagedClusterPodIdentityProvisioningInfo", + "ManagedClusterPoolUpgradeProfile", + "ManagedClusterPoolUpgradeProfileUpgradesItem", + "ManagedClusterPropertiesAutoScalerProfile", + "ManagedClusterPropertiesForSnapshot", + "ManagedClusterSKU", + "ManagedClusterSecurityProfile", + "ManagedClusterSecurityProfileDefender", + "ManagedClusterSecurityProfileDefenderSecurityMonitoring", + "ManagedClusterSecurityProfileImageCleaner", + "ManagedClusterSecurityProfileNodeRestriction", + "ManagedClusterSecurityProfileWorkloadIdentity", + "ManagedClusterServicePrincipalProfile", + "ManagedClusterSnapshot", + "ManagedClusterSnapshotListResult", + "ManagedClusterStorageProfile", + "ManagedClusterStorageProfileBlobCSIDriver", + "ManagedClusterStorageProfileDiskCSIDriver", + "ManagedClusterStorageProfileFileCSIDriver", + "ManagedClusterStorageProfileSnapshotController", + "ManagedClusterUpgradeProfile", + "ManagedClusterWindowsProfile", + "ManagedClusterWorkloadAutoScalerProfile", + "ManagedClusterWorkloadAutoScalerProfileKeda", + "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", + "ManagedServiceIdentityUserAssignedIdentitiesValue", + "NetworkProfileForSnapshot", + "OSOptionProfile", + "OSOptionProperty", + "OperationListResult", + "OperationValue", + "OutboundEnvironmentEndpoint", + "OutboundEnvironmentEndpointCollection", + "PowerState", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateLinkResource", + "PrivateLinkResourcesListResult", + "PrivateLinkServiceConnectionState", + "Resource", + "ResourceReference", + "RunCommandRequest", + "RunCommandResult", + "Snapshot", + "SnapshotListResult", + "SubResource", + "SysctlConfig", + "SystemData", + "TagsObject", + "TimeInWeek", + "TimeSpan", + "TrackedResource", + "TrustedAccessRole", + "TrustedAccessRoleBinding", + "TrustedAccessRoleBindingListResult", + "TrustedAccessRoleListResult", + "TrustedAccessRoleRule", + "UserAssignedIdentity", + "WindowsGmsaProfile", + "AgentPoolMode", + "AgentPoolType", + "Code", + "ConnectionStatus", + "ContainerServiceStorageProfileTypes", + "ContainerServiceVMSizeTypes", + "ControlledValues", + "Count", + "CreatedByType", + "Expander", + "ExtendedLocationTypes", + "FleetMemberProvisioningState", + "FleetProvisioningState", + "Format", + "GPUInstanceProfile", + "IpFamily", + "KeyVaultNetworkAccessTypes", + "KubeletDiskType", + "LicenseType", + "LoadBalancerSku", + "ManagedClusterPodIdentityProvisioningState", + "ManagedClusterSKUName", + "ManagedClusterSKUTier", + "NetworkMode", + "NetworkPlugin", + "NetworkPluginMode", + "NetworkPolicy", + "OSDiskType", + "OSSKU", + "OSType", + "OutboundType", + "PrivateEndpointConnectionProvisioningState", + "PublicNetworkAccess", + "ResourceIdentityType", + "ScaleDownMode", + "ScaleSetEvictionPolicy", + "ScaleSetPriority", + "SnapshotType", + "TrustedAccessRoleBindingProvisioningState", + "UpdateMode", + "UpgradeChannel", + "WeekDay", + "WorkloadRuntime", ] __all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() \ No newline at end of file +_patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_container_service_client_enums.py index 33a00c453da3..daa2d0cb3f88 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_container_service_client_enums.py @@ -23,33 +23,34 @@ class AgentPoolMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: User agent pools are primarily for hosting your application pods. USER = "User" + class AgentPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of Agent Pool. - """ + """The type of Agent Pool.""" #: Create an Agent Pool backed by a Virtual Machine Scale Set. VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" #: Use of this is strongly discouraged. AVAILABILITY_SET = "AvailabilitySet" + class Code(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Tells whether the cluster is Running or Stopped. - """ + """Tells whether the cluster is Running or Stopped.""" #: The cluster is running. RUNNING = "Running" #: The cluster is stopped. STOPPED = "Stopped" + class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The private link service connection status. - """ + """The private link service connection status.""" PENDING = "Pending" APPROVED = "Approved" REJECTED = "Rejected" DISCONNECTED = "Disconnected" + class ContainerServiceStorageProfileTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf based on the choice of orchestrator. @@ -58,9 +59,9 @@ class ContainerServiceStorageProfileTypes(str, Enum, metaclass=CaseInsensitiveEn STORAGE_ACCOUNT = "StorageAccount" MANAGED_DISKS = "ManagedDisks" + class ContainerServiceVMSizeTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Size of agent VMs. Note: This is no longer maintained. - """ + """Size of agent VMs. Note: This is no longer maintained.""" STANDARD_A1 = "Standard_A1" STANDARD_A10 = "Standard_A10" @@ -237,15 +238,16 @@ class ContainerServiceVMSizeTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD_NV24 = "Standard_NV24" STANDARD_NV6 = "Standard_NV6" + class ControlledValues(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Controls which resource value autoscaler will change. Default value is RequestsAndLimits. - """ + """Controls which resource value autoscaler will change. Default value is RequestsAndLimits.""" #: Autoscaler will control resource requests and limits. REQUESTS_AND_LIMITS = "RequestsAndLimits" #: Autoscaler will control resource requests only. REQUESTS_ONLY = "RequestsOnly" + class Count(int, Enum, metaclass=CaseInsensitiveEnumMeta): """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. @@ -255,15 +257,16 @@ class Count(int, Enum, metaclass=CaseInsensitiveEnumMeta): THREE = 3 FIVE = 5 + class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource. - """ + """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 `_ @@ -287,15 +290,15 @@ class Expander(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Used when you don't have a particular need for the node groups to scale differently. RANDOM = "random" + class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of extendedLocation. - """ + """The type of extendedLocation.""" EDGE_ZONE = "EdgeZone" + class FleetMemberProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state of the last accepted operation. - """ + """The provisioning state of the last accepted operation.""" SUCCEEDED = "Succeeded" FAILED = "Failed" @@ -304,9 +307,9 @@ class FleetMemberProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta) LEAVING = "Leaving" UPDATING = "Updating" + class FleetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The provisioning state of the last accepted operation. - """ + """The provisioning state of the last accepted operation.""" SUCCEEDED = "Succeeded" FAILED = "Failed" @@ -315,9 +318,9 @@ class FleetProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): DELETING = "Deleting" UPDATING = "Updating" + class Format(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Format. - """ + """Format.""" #: Return azure auth-provider kubeconfig. This format is deprecated in 1.22 and will be fully #: removed in 1.25. @@ -325,9 +328,9 @@ class Format(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Return exec format kubeconfig. This format requires kubelogin binary in the path. EXEC = "exec" + class GPUInstanceProfile(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. - """ + """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.""" MIG1_G = "MIG1g" MIG2_G = "MIG2g" @@ -335,13 +338,14 @@ class GPUInstanceProfile(str, Enum, metaclass=CaseInsensitiveEnumMeta): MIG4_G = "MIG4g" MIG7_G = "MIG7g" + class IpFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The IP version to use for cluster networking and IP assignment. - """ + """The IP version to use for cluster networking and IP assignment.""" I_PV4 = "IPv4" I_PV6 = "IPv6" + 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 @@ -351,6 +355,7 @@ class KeyVaultNetworkAccessTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): PUBLIC = "Public" PRIVATE = "Private" + class KubeletDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. @@ -361,6 +366,7 @@ class KubeletDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Kubelet will use the temporary disk for its data. TEMPORARY = "Temporary" + class LicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The license type to use for Windows VMs. See `Azure Hybrid User Benefits `_ for more details. @@ -371,6 +377,7 @@ class LicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Enables Azure Hybrid User Benefits for Windows VMs. WINDOWS_SERVER = "Windows_Server" + class LoadBalancerSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The default is 'standard'. See `Azure Load Balancer SKUs `_ for more information about the @@ -384,21 +391,24 @@ class LoadBalancerSku(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Use a basic Load Balancer with limited functionality. BASIC = "basic" + class ManagedClusterPodIdentityProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state of the pod identity. - """ + """The current provisioning state of the pod identity.""" ASSIGNED = "Assigned" - UPDATING = "Updating" + CANCELED = "Canceled" DELETING = "Deleting" FAILED = "Failed" + SUCCEEDED = "Succeeded" + UPDATING = "Updating" + class ManagedClusterSKUName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The name of a managed cluster SKU. - """ + """The name of a managed cluster SKU.""" BASIC = "Basic" + class ManagedClusterSKUTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """If not specified, the default is 'Free'. See `uptime SLA `_ for more details. @@ -410,9 +420,9 @@ class ManagedClusterSKUTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: No guaranteed SLA, no additional charges. Free tier clusters have an SLO of 99.5%. FREE = "Free" + class NetworkMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """This cannot be specified if networkPlugin is anything other than 'azure'. - """ + """This cannot be specified if networkPlugin is anything other than 'azure'.""" #: No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure #: CNI. See `Transparent Mode `_ for @@ -421,9 +431,9 @@ class NetworkMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: This is no longer supported BRIDGE = "bridge" + class NetworkPlugin(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Network plugin used for building the Kubernetes network. - """ + """Network plugin used for building the Kubernetes network.""" #: Use the Azure CNI network plugin. See `Azure CNI (advanced) networking #: `_ for @@ -437,17 +447,17 @@ class NetworkPlugin(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: networking functionality. NONE = "none" + class NetworkPluginMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The mode the network plugin should use. - """ + """The mode the network plugin should use.""" #: Pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than #: Kubenet reference plugins host-local and bridge. OVERLAY = "Overlay" + class NetworkPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Network policy used for building the Kubernetes network. - """ + """Network policy used for building the Kubernetes network.""" #: Use Calico network policies. See `differences between Azure and Calico policies #: `_ @@ -458,6 +468,7 @@ class NetworkPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: for more information. AZURE = "azure" + 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 @@ -474,6 +485,7 @@ class OSDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: provides lower read/write latency, along with faster node scaling and cluster upgrades. EPHEMERAL = "Ephemeral" + 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 @@ -485,15 +497,16 @@ class OSSKU(str, Enum, metaclass=CaseInsensitiveEnumMeta): WINDOWS2019 = "Windows2019" WINDOWS2022 = "Windows2022" + class OSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The operating system type. The default is Linux. - """ + """The operating system type. The default is Linux.""" #: Use Linux. LINUX = "Linux" #: Use Windows. WINDOWS = "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 `_. @@ -514,18 +527,19 @@ class OutboundType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: advanced scenario and requires proper network configuration. USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" + class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state. - """ + """The current provisioning state.""" - SUCCEEDED = "Succeeded" + CANCELED = "Canceled" CREATING = "Creating" DELETING = "Deleting" FAILED = "Failed" + SUCCEEDED = "Succeeded" + class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Allow or deny public network access for AKS. - """ + """Allow or deny public network access for AKS.""" #: Inbound/Outbound to the managedCluster is allowed. ENABLED = "Enabled" @@ -534,6 +548,7 @@ class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Inbound/Outbound traffic is managed by Microsoft.Network/NetworkSecurityPerimeters. SECURED_BY_PERIMETER = "SecuredByPerimeter" + class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """For more information see `use managed identities in AKS `_. @@ -550,6 +565,7 @@ class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Do not use a managed identity for the Managed Cluster, service principal will be used instead. NONE = "None" + class ScaleDownMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Describes how VMs are added to or removed from Agent Pools. See `billing states `_. @@ -561,6 +577,7 @@ class ScaleDownMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: during scale down. DEALLOCATE = "Deallocate" + 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 @@ -574,9 +591,9 @@ class ScaleSetEvictionPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: cause issues with cluster scaling or upgrading. DEALLOCATE = "Deallocate" + class ScaleSetPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The Virtual Machine Scale Set priority. - """ + """The Virtual Machine Scale Set priority.""" #: Spot priority VMs will be used. There is no SLA for spot nodes. See `spot on AKS #: `_ for more information. @@ -584,23 +601,25 @@ class ScaleSetPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Regular VMs will be used. REGULAR = "Regular" + class SnapshotType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of a snapshot. The default is NodePool. - """ + """The type of a snapshot. The default is NodePool.""" #: The snapshot is a snapshot of a node pool. NODE_POOL = "NodePool" #: The snapshot is a snapshot of a managed cluster. MANAGED_CLUSTER = "ManagedCluster" + class TrustedAccessRoleBindingProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current provisioning state of trusted access role binding. - """ + """The current provisioning state of trusted access role binding.""" - SUCCEEDED = "Succeeded" + CANCELED = "Canceled" + DELETING = "Deleting" FAILED = "Failed" + SUCCEEDED = "Succeeded" UPDATING = "Updating" - DELETING = "Deleting" + class UpdateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Each update mode level is a superset of the lower levels. Off`_. @@ -651,9 +671,9 @@ class UpgradeChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): #: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. NONE = "none" + class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The weekday enum. - """ + """The weekday enum.""" SUNDAY = "Sunday" MONDAY = "Monday" @@ -663,9 +683,9 @@ class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): FRIDAY = "Friday" SATURDAY = "Saturday" + class WorkloadRuntime(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Determines the type of workload a node can run. - """ + """Determines the type of workload a node can run.""" #: Nodes will use Kubelet to run standard OCI container workloads. OCI_CONTAINER = "OCIContainer" 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 bc9559b6dd19..df0bfd67f1d3 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 @@ -32,9 +32,9 @@ class SubResource(_serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, } _attribute_map = { @@ -43,12 +43,8 @@ class SubResource(_serialization.Model): "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.id = None self.name = None @@ -232,13 +228,13 @@ class AgentPool(SubResource): # pylint: disable=too-many-instance-attributes """ _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}, + "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 = { @@ -560,16 +556,19 @@ class AgentPoolAvailableVersions(_serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + "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]"}, + "agent_pool_versions": { + "key": "properties.agentPoolVersions", + "type": "[AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem]", + }, } def __init__( @@ -641,7 +640,7 @@ class AgentPoolListResult(_serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { @@ -649,12 +648,7 @@ class AgentPoolListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["_models.AgentPool"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.AgentPool"]] = None, **kwargs): """ :keyword value: The list of agent pools. :paramtype value: list[~azure.mgmt.containerservice.v2022_07_02_preview.models.AgentPool] @@ -690,11 +684,11 @@ class AgentPoolUpgradeProfile(_serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "kubernetes_version": {"required": True}, + "os_type": {"required": True}, } _attribute_map = { @@ -752,13 +746,7 @@ class AgentPoolUpgradeProfilePropertiesUpgradesItem(_serialization.Model): "is_preview": {"key": "isPreview", "type": "bool"}, } - def __init__( - self, - *, - kubernetes_version: Optional[str] = None, - is_preview: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, kubernetes_version: Optional[str] = None, is_preview: Optional[bool] = None, **kwargs): """ :keyword kubernetes_version: The Kubernetes version (major.minor.patch). :paramtype kubernetes_version: str @@ -785,12 +773,7 @@ class AgentPoolUpgradeSettings(_serialization.Model): "max_surge": {"key": "maxSurge", "type": "str"}, } - def __init__( - self, - *, - max_surge: Optional[str] = None, - **kwargs - ): + def __init__(self, *, max_surge: Optional[str] = None, **kwargs): """ :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 @@ -822,10 +805,10 @@ class Resource(_serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { @@ -835,12 +818,8 @@ class Resource(_serialization.Model): "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.id = None self.name = None @@ -869,11 +848,11 @@ class AzureEntityResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'etag': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "etag": {"readonly": True}, } _attribute_map = { @@ -884,12 +863,8 @@ class AzureEntityResource(Resource): "etag": {"key": "etag", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.etag = None @@ -1025,19 +1000,14 @@ class ContainerServiceDiagnosticsProfile(_serialization.Model): """ _validation = { - 'vm_diagnostics': {'required': True}, + "vm_diagnostics": {"required": True}, } _attribute_map = { "vm_diagnostics": {"key": "vmDiagnostics", "type": "ContainerServiceVMDiagnostics"}, } - def __init__( - self, - *, - vm_diagnostics: "_models.ContainerServiceVMDiagnostics", - **kwargs - ): + def __init__(self, *, vm_diagnostics: "_models.ContainerServiceVMDiagnostics", **kwargs): """ :keyword vm_diagnostics: Profile for diagnostics on the container service VMs. Required. :paramtype vm_diagnostics: @@ -1060,8 +1030,8 @@ class ContainerServiceLinuxProfile(_serialization.Model): """ _validation = { - 'admin_username': {'required': True, 'pattern': r'^[A-Za-z][-A-Za-z0-9_]*$'}, - 'ssh': {'required': True}, + "admin_username": {"required": True, "pattern": r"^[A-Za-z][-A-Za-z0-9_]*$"}, + "ssh": {"required": True}, } _attribute_map = { @@ -1069,13 +1039,7 @@ class ContainerServiceLinuxProfile(_serialization.Model): "ssh": {"key": "ssh", "type": "ContainerServiceSshConfiguration"}, } - def __init__( - self, - *, - admin_username: str, - ssh: "_models.ContainerServiceSshConfiguration", - **kwargs - ): + def __init__(self, *, admin_username: str, ssh: "_models.ContainerServiceSshConfiguration", **kwargs): """ :keyword admin_username: The administrator username to use for Linux VMs. Required. :paramtype admin_username: str @@ -1159,10 +1123,10 @@ class ContainerServiceMasterProfile(_serialization.Model): """ _validation = { - 'dns_prefix': {'required': True}, - 'vm_size': {'required': True}, - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'fqdn': {'readonly': True}, + "dns_prefix": {"required": True}, + "vm_size": {"required": True}, + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "fqdn": {"readonly": True}, } _attribute_map = { @@ -1322,10 +1286,12 @@ class ContainerServiceNetworkProfile(_serialization.Model): # pylint: disable=t """ _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]?)$'}, - 'docker_bridge_cidr': {'pattern': r'^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$'}, + "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]?)$" + }, + "docker_bridge_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, } _attribute_map = { @@ -1454,19 +1420,14 @@ class ContainerServiceSshConfiguration(_serialization.Model): """ _validation = { - 'public_keys': {'required': True}, + "public_keys": {"required": True}, } _attribute_map = { "public_keys": {"key": "publicKeys", "type": "[ContainerServiceSshPublicKey]"}, } - def __init__( - self, - *, - public_keys: List["_models.ContainerServiceSshPublicKey"], - **kwargs - ): + def __init__(self, *, public_keys: List["_models.ContainerServiceSshPublicKey"], **kwargs): """ :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. @@ -1488,19 +1449,14 @@ class ContainerServiceSshPublicKey(_serialization.Model): """ _validation = { - 'key_data': {'required': True}, + "key_data": {"required": True}, } _attribute_map = { "key_data": {"key": "keyData", "type": "str"}, } - def __init__( - self, - *, - key_data: str, - **kwargs - ): + def __init__(self, *, key_data: str, **kwargs): """ :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. @@ -1524,8 +1480,8 @@ class ContainerServiceVMDiagnostics(_serialization.Model): """ _validation = { - 'enabled': {'required': True}, - 'storage_uri': {'readonly': True}, + "enabled": {"required": True}, + "storage_uri": {"readonly": True}, } _attribute_map = { @@ -1533,12 +1489,7 @@ class ContainerServiceVMDiagnostics(_serialization.Model): "storage_uri": {"key": "storageUri", "type": "str"}, } - def __init__( - self, - *, - enabled: bool, - **kwargs - ): + def __init__(self, *, enabled: bool, **kwargs): """ :keyword enabled: Whether the VM diagnostic agent is provisioned on the VM. Required. :paramtype enabled: bool @@ -1560,12 +1511,7 @@ class CreationData(_serialization.Model): "source_resource_id": {"key": "sourceResourceId", "type": "str"}, } - def __init__( - self, - *, - source_resource_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, source_resource_id: Optional[str] = None, **kwargs): """ :keyword source_resource_id: This is the ARM ID of the source object to be used to create the target object. @@ -1587,8 +1533,8 @@ class CredentialResult(_serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { @@ -1596,12 +1542,8 @@ class CredentialResult(_serialization.Model): "value": {"key": "value", "type": "bytearray"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.name = None self.value = None @@ -1618,19 +1560,15 @@ class CredentialResults(_serialization.Model): """ _validation = { - 'kubeconfigs': {'readonly': True}, + "kubeconfigs": {"readonly": True}, } _attribute_map = { "kubeconfigs": {"key": "kubeconfigs", "type": "[CredentialResult]"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.kubeconfigs = None @@ -1727,8 +1665,8 @@ class ErrorAdditionalInfo(_serialization.Model): """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { @@ -1736,12 +1674,8 @@ class ErrorAdditionalInfo(_serialization.Model): "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.type = None self.info = None @@ -1766,11 +1700,11 @@ class ErrorDetail(_serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { @@ -1781,12 +1715,8 @@ class ErrorDetail(_serialization.Model): "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.code = None self.message = None @@ -1806,12 +1736,7 @@ class ErrorResponse(_serialization.Model): "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - *, - error: Optional["_models.ErrorDetail"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs): """ :keyword error: The error object. :paramtype error: ~azure.mgmt.containerservice.v2022_07_02_preview.models.ErrorDetail @@ -1879,11 +1804,11 @@ class TrackedResource(Resource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { @@ -1895,13 +1820,7 @@ class TrackedResource(Resource): "location": {"key": "location", "type": "str"}, } - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs): """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -1946,13 +1865,13 @@ class Fleet(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'etag': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { @@ -2001,8 +1920,8 @@ class FleetCredentialResult(_serialization.Model): """ _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, + "name": {"readonly": True}, + "value": {"readonly": True}, } _attribute_map = { @@ -2010,12 +1929,8 @@ class FleetCredentialResult(_serialization.Model): "value": {"key": "value", "type": "bytearray"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.name = None self.value = None @@ -2032,19 +1947,15 @@ class FleetCredentialResults(_serialization.Model): """ _validation = { - 'kubeconfigs': {'readonly': True}, + "kubeconfigs": {"readonly": True}, } _attribute_map = { "kubeconfigs": {"key": "kubeconfigs", "type": "[FleetCredentialResult]"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.kubeconfigs = None @@ -2063,8 +1974,8 @@ class FleetHubProfile(_serialization.Model): """ _validation = { - 'fqdn': {'readonly': True}, - 'kubernetes_version': {'readonly': True}, + "fqdn": {"readonly": True}, + "kubernetes_version": {"readonly": True}, } _attribute_map = { @@ -2073,12 +1984,7 @@ class FleetHubProfile(_serialization.Model): "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, } - def __init__( - self, - *, - dns_prefix: Optional[str] = None, - **kwargs - ): + def __init__(self, *, dns_prefix: Optional[str] = None, **kwargs): """ :keyword dns_prefix: DNS prefix used to create the FQDN for the Fleet hub. :paramtype dns_prefix: str @@ -2101,7 +2007,7 @@ class FleetListResult(_serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { @@ -2109,12 +2015,7 @@ class FleetListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["_models.Fleet"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.Fleet"]] = None, **kwargs): """ :keyword value: The list of Fleets. :paramtype value: list[~azure.mgmt.containerservice.v2022_07_02_preview.models.Fleet] @@ -2153,12 +2054,12 @@ class FleetMember(AzureEntityResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'etag': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "etag": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { @@ -2171,12 +2072,7 @@ class FleetMember(AzureEntityResource): "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, } - def __init__( - self, - *, - cluster_resource_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, cluster_resource_id: Optional[str] = None, **kwargs): """ :keyword cluster_resource_id: The ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: @@ -2200,7 +2096,7 @@ class FleetMembersListResult(_serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { @@ -2208,12 +2104,7 @@ class FleetMembersListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["_models.FleetMember"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.FleetMember"]] = None, **kwargs): """ :keyword value: The list of members in a given Fleet. :paramtype value: list[~azure.mgmt.containerservice.v2022_07_02_preview.models.FleetMember] @@ -2234,12 +2125,7 @@ class FleetPatch(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -2288,7 +2174,7 @@ class KubeletConfig(_serialization.Model): # pylint: disable=too-many-instance- """ _validation = { - 'container_log_max_files': {'minimum': 2}, + "container_log_max_files": {"minimum": 2}, } _attribute_map = { @@ -2450,10 +2336,10 @@ class MaintenanceConfiguration(SubResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { @@ -2500,7 +2386,7 @@ class MaintenanceConfigurationListResult(_serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { @@ -2508,12 +2394,7 @@ class MaintenanceConfigurationListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["_models.MaintenanceConfiguration"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.MaintenanceConfiguration"]] = None, **kwargs): """ :keyword value: The list of maintenance configurations. :paramtype value: @@ -2674,18 +2555,18 @@ class ManagedCluster(TrackedResource): # pylint: disable=too-many-instance-attr """ _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}, + "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}, } _attribute_map = { @@ -2712,7 +2593,10 @@ class ManagedCluster(TrackedResource): # pylint: disable=too-many-instance-attr "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"}, + "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"}, @@ -2723,8 +2607,14 @@ class ManagedCluster(TrackedResource): # pylint: disable=too-many-instance-attr "network_profile": {"key": "properties.networkProfile", "type": "ContainerServiceNetworkProfile"}, "aad_profile": {"key": "properties.aadProfile", "type": "ManagedClusterAADProfile"}, "auto_upgrade_profile": {"key": "properties.autoUpgradeProfile", "type": "ManagedClusterAutoUpgradeProfile"}, - "auto_scaler_profile": {"key": "properties.autoScalerProfile", "type": "ManagedClusterPropertiesAutoScalerProfile"}, - "api_server_access_profile": {"key": "properties.apiServerAccessProfile", "type": "ManagedClusterAPIServerAccessProfile"}, + "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]"}, @@ -2734,7 +2624,10 @@ class ManagedCluster(TrackedResource): # pylint: disable=too-many-instance-attr "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"}, + "workload_auto_scaler_profile": { + "key": "properties.workloadAutoScalerProfile", + "type": "ManagedClusterWorkloadAutoScalerProfile", + }, "azure_monitor_profile": {"key": "properties.azureMonitorProfile", "type": "ManagedClusterAzureMonitorProfile"}, } @@ -3037,11 +2930,11 @@ class ManagedClusterAccessProfile(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { @@ -3055,12 +2948,7 @@ class ManagedClusterAccessProfile(TrackedResource): } def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - kube_config: Optional[bytes] = None, - **kwargs + self, *, location: str, tags: Optional[Dict[str, str]] = None, kube_config: Optional[bytes] = None, **kwargs ): """ :keyword tags: Resource tags. @@ -3091,8 +2979,8 @@ class ManagedClusterAddonProfile(_serialization.Model): """ _validation = { - 'enabled': {'required': True}, - 'identity': {'readonly': True}, + "enabled": {"required": True}, + "identity": {"readonly": True}, } _attribute_map = { @@ -3101,13 +2989,7 @@ class ManagedClusterAddonProfile(_serialization.Model): "identity": {"key": "identity", "type": "ManagedClusterAddonProfileIdentity"}, } - def __init__( - self, - *, - enabled: bool, - config: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, enabled: bool, config: Optional[Dict[str, str]] = None, **kwargs): """ :keyword enabled: Whether the add-on is enabled or not. Required. :paramtype enabled: bool @@ -3364,10 +3246,10 @@ class ManagedClusterAgentPoolProfileProperties(_serialization.Model): # pylint: """ _validation = { - 'os_disk_size_gb': {'maximum': 2048, 'minimum': 0}, - 'current_orchestrator_version': {'readonly': True}, - 'node_image_version': {'readonly': True}, - 'provisioning_state': {'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 = { @@ -3668,7 +3550,9 @@ def __init__( # pylint: disable=too-many-locals self.host_group_id = host_group_id -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): # pylint: disable=too-many-instance-attributes +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. @@ -3841,11 +3725,11 @@ class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): """ _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}$'}, + "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 = { @@ -4103,7 +3987,50 @@ def __init__( # pylint: disable=too-many-locals :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, 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, 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, **kwargs) + 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, + 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, + 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, + **kwargs + ) self.name = name @@ -4206,12 +4133,7 @@ class ManagedClusterAutoUpgradeProfile(_serialization.Model): "upgrade_channel": {"key": "upgradeChannel", "type": "str"}, } - def __init__( - self, - *, - upgrade_channel: Optional[Union[str, "_models.UpgradeChannel"]] = None, - **kwargs - ): + def __init__(self, *, upgrade_channel: Optional[Union[str, "_models.UpgradeChannel"]] = None, **kwargs): """ :keyword upgrade_channel: For more information see `setting the AKS cluster auto-upgrade channel `_. @@ -4235,12 +4157,7 @@ class ManagedClusterAzureMonitorProfile(_serialization.Model): "metrics": {"key": "metrics", "type": "ManagedClusterAzureMonitorProfileMetrics"}, } - def __init__( - self, - *, - metrics: Optional["_models.ManagedClusterAzureMonitorProfileMetrics"] = None, - **kwargs - ): + def __init__(self, *, metrics: Optional["_models.ManagedClusterAzureMonitorProfileMetrics"] = None, **kwargs): """ :keyword metrics: Metrics profile for the prometheus service addon. :paramtype metrics: @@ -4300,7 +4217,7 @@ class ManagedClusterAzureMonitorProfileMetrics(_serialization.Model): """ _validation = { - 'enabled': {'required': True}, + "enabled": {"required": True}, } _attribute_map = { @@ -4347,7 +4264,7 @@ class ManagedClusterHTTPProxyConfig(_serialization.Model): """ _validation = { - 'effective_no_proxy': {'readonly': True}, + "effective_no_proxy": {"readonly": True}, } _attribute_map = { @@ -4408,22 +4325,27 @@ class ManagedClusterIdentity(_serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, + "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"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{ManagedServiceIdentityUserAssignedIdentitiesValue}"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{ManagedServiceIdentityUserAssignedIdentitiesValue}", + }, } def __init__( self, *, type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, - user_assigned_identities: Optional[Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentitiesValue"]] = None, + user_assigned_identities: Optional[ + Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentitiesValue"] + ] = None, **kwargs ): """ @@ -4457,10 +4379,7 @@ class ManagedClusterIngressProfile(_serialization.Model): } def __init__( - self, - *, - web_app_routing: Optional["_models.ManagedClusterIngressProfileWebAppRouting"] = None, - **kwargs + self, *, web_app_routing: Optional["_models.ManagedClusterIngressProfileWebAppRouting"] = None, **kwargs ): """ :keyword web_app_routing: Web App Routing settings for the ingress profile. @@ -4486,13 +4405,7 @@ class ManagedClusterIngressProfileWebAppRouting(_serialization.Model): "dns_zone_resource_id": {"key": "dnsZoneResourceId", "type": "str"}, } - def __init__( - self, - *, - enabled: Optional[bool] = None, - dns_zone_resource_id: Optional[str] = None, - **kwargs - ): + def __init__(self, *, enabled: Optional[bool] = None, dns_zone_resource_id: Optional[str] = None, **kwargs): """ :keyword enabled: Whether to enable Web App Routing. :paramtype enabled: bool @@ -4517,7 +4430,7 @@ class ManagedClusterListResult(_serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { @@ -4525,12 +4438,7 @@ class ManagedClusterListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["_models.ManagedCluster"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.ManagedCluster"]] = None, **kwargs): """ :keyword value: The list of managed clusters. :paramtype value: list[~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedCluster] @@ -4569,13 +4477,19 @@ class ManagedClusterLoadBalancerProfile(_serialization.Model): """ _validation = { - 'allocated_outbound_ports': {'maximum': 64000, 'minimum': 0}, - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + "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"}, + "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"}, @@ -4645,8 +4559,8 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(_serialization.Model): """ _validation = { - 'count': {'maximum': 100, 'minimum': 1}, - 'count_ipv6': {'maximum': 100, 'minimum': 0}, + "count": {"maximum": 100, "minimum": 1}, + "count_ipv6": {"maximum": 100, "minimum": 0}, } _attribute_map = { @@ -4654,13 +4568,7 @@ class ManagedClusterLoadBalancerProfileManagedOutboundIPs(_serialization.Model): "count_ipv6": {"key": "countIPv6", "type": "int"}, } - def __init__( - self, - *, - count: int = 1, - count_ipv6: int = 0, - **kwargs - ): + def __init__(self, *, count: int = 1, count_ipv6: int = 0, **kwargs): """ :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 @@ -4688,12 +4596,7 @@ class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(_serialization.Model): "public_ip_prefixes": {"key": "publicIPPrefixes", "type": "[ResourceReference]"}, } - def __init__( - self, - *, - public_ip_prefixes: Optional[List["_models.ResourceReference"]] = None, - **kwargs - ): + def __init__(self, *, public_ip_prefixes: Optional[List["_models.ResourceReference"]] = None, **kwargs): """ :keyword public_ip_prefixes: A list of public IP prefix resources. :paramtype public_ip_prefixes: @@ -4715,12 +4618,7 @@ class ManagedClusterLoadBalancerProfileOutboundIPs(_serialization.Model): "public_i_ps": {"key": "publicIPs", "type": "[ResourceReference]"}, } - def __init__( - self, - *, - public_i_ps: Optional[List["_models.ResourceReference"]] = None, - **kwargs - ): + def __init__(self, *, public_i_ps: Optional[List["_models.ResourceReference"]] = None, **kwargs): """ :keyword public_i_ps: A list of public IP resources. :paramtype public_i_ps: @@ -4739,19 +4637,14 @@ class ManagedClusterManagedOutboundIPProfile(_serialization.Model): """ _validation = { - 'count': {'maximum': 16, 'minimum': 1}, + "count": {"maximum": 16, "minimum": 1}, } _attribute_map = { "count": {"key": "count", "type": "int"}, } - def __init__( - self, - *, - count: int = 1, - **kwargs - ): + def __init__(self, *, count: int = 1, **kwargs): """ :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. @@ -4777,11 +4670,14 @@ class ManagedClusterNATGatewayProfile(_serialization.Model): """ _validation = { - 'idle_timeout_in_minutes': {'maximum': 120, 'minimum': 4}, + "idle_timeout_in_minutes": {"maximum": 120, "minimum": 4}, } _attribute_map = { - "managed_outbound_ip_profile": {"key": "managedOutboundIPProfile", "type": "ManagedClusterManagedOutboundIPProfile"}, + "managed_outbound_ip_profile": { + "key": "managedOutboundIPProfile", + "type": "ManagedClusterManagedOutboundIPProfile", + }, "effective_outbound_i_ps": {"key": "effectiveOutboundIPs", "type": "[ResourceReference]"}, "idle_timeout_in_minutes": {"key": "idleTimeoutInMinutes", "type": "int"}, } @@ -4825,7 +4721,7 @@ class ManagedClusterOIDCIssuerProfile(_serialization.Model): """ _validation = { - 'issuer_url': {'readonly': True}, + "issuer_url": {"readonly": True}, } _attribute_map = { @@ -4833,12 +4729,7 @@ class ManagedClusterOIDCIssuerProfile(_serialization.Model): "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - *, - enabled: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, enabled: Optional[bool] = None, **kwargs): """ :keyword enabled: Whether the OIDC issuer is enabled. :paramtype enabled: bool @@ -4864,7 +4755,7 @@ class ManagedClusterPodIdentity(_serialization.Model): :ivar identity: The user assigned identity details. Required. :vartype identity: ~azure.mgmt.containerservice.v2022_07_02_preview.models.UserAssignedIdentity :ivar provisioning_state: The current provisioning state of the pod identity. Known values are: - "Assigned", "Updating", "Deleting", and "Failed". + "Assigned", "Canceled", "Deleting", "Failed", "Succeeded", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2022_07_02_preview.models.ManagedClusterPodIdentityProvisioningState :ivar provisioning_info: @@ -4873,11 +4764,11 @@ class ManagedClusterPodIdentity(_serialization.Model): """ _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'identity': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'provisioning_info': {'readonly': True}, + "name": {"required": True}, + "namespace": {"required": True}, + "identity": {"required": True}, + "provisioning_state": {"readonly": True}, + "provisioning_info": {"readonly": True}, } _attribute_map = { @@ -4932,9 +4823,9 @@ class ManagedClusterPodIdentityException(_serialization.Model): """ _validation = { - 'name': {'required': True}, - 'namespace': {'required': True}, - 'pod_labels': {'required': True}, + "name": {"required": True}, + "namespace": {"required": True}, + "pod_labels": {"required": True}, } _attribute_map = { @@ -4943,14 +4834,7 @@ class ManagedClusterPodIdentityException(_serialization.Model): "pod_labels": {"key": "podLabels", "type": "{str}"}, } - def __init__( - self, - *, - name: str, - namespace: str, - pod_labels: Dict[str, str], - **kwargs - ): + def __init__(self, *, name: str, namespace: str, pod_labels: Dict[str, str], **kwargs): """ :keyword name: The name of the pod identity exception. Required. :paramtype name: str @@ -4988,7 +4872,10 @@ class ManagedClusterPodIdentityProfile(_serialization.Model): "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]"}, + "user_assigned_identity_exceptions": { + "key": "userAssignedIdentityExceptions", + "type": "[ManagedClusterPodIdentityException]", + }, } def __init__( @@ -5035,12 +4922,7 @@ class ManagedClusterPodIdentityProvisioningError(_serialization.Model): "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningErrorBody"}, } - def __init__( - self, - *, - error: Optional["_models.ManagedClusterPodIdentityProvisioningErrorBody"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs): """ :keyword error: Details about the error. :paramtype error: @@ -5116,12 +4998,7 @@ class ManagedClusterPodIdentityProvisioningInfo(_serialization.Model): "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningError"}, } - def __init__( - self, - *, - error: Optional["_models.ManagedClusterPodIdentityProvisioningError"] = None, - **kwargs - ): + def __init__(self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningError"] = None, **kwargs): """ :keyword error: Pod identity assignment error (if any). :paramtype error: @@ -5149,8 +5026,8 @@ class ManagedClusterPoolUpgradeProfile(_serialization.Model): """ _validation = { - 'kubernetes_version': {'required': True}, - 'os_type': {'required': True}, + "kubernetes_version": {"required": True}, + "os_type": {"required": True}, } _attribute_map = { @@ -5202,13 +5079,7 @@ class ManagedClusterPoolUpgradeProfileUpgradesItem(_serialization.Model): "is_preview": {"key": "isPreview", "type": "bool"}, } - def __init__( - self, - *, - kubernetes_version: Optional[str] = None, - is_preview: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, kubernetes_version: Optional[str] = None, is_preview: Optional[bool] = None, **kwargs): """ :keyword kubernetes_version: The Kubernetes version (major.minor.patch). :paramtype kubernetes_version: str @@ -5397,7 +5268,7 @@ class ManagedClusterPropertiesForSnapshot(_serialization.Model): """ _validation = { - 'network_profile': {'readonly': True}, + "network_profile": {"readonly": True}, } _attribute_map = { @@ -5520,7 +5391,10 @@ class ManagedClusterSecurityProfileDefender(_serialization.Model): _attribute_map = { "log_analytics_workspace_resource_id": {"key": "logAnalyticsWorkspaceResourceId", "type": "str"}, - "security_monitoring": {"key": "securityMonitoring", "type": "ManagedClusterSecurityProfileDefenderSecurityMonitoring"}, + "security_monitoring": { + "key": "securityMonitoring", + "type": "ManagedClusterSecurityProfileDefenderSecurityMonitoring", + }, } def __init__( @@ -5557,12 +5431,7 @@ class ManagedClusterSecurityProfileDefenderSecurityMonitoring(_serialization.Mod "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - *, - enabled: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, enabled: Optional[bool] = None, **kwargs): """ :keyword enabled: Whether to enable Defender threat detection. :paramtype enabled: bool @@ -5585,13 +5454,7 @@ class ManagedClusterSecurityProfileImageCleaner(_serialization.Model): "interval_hours": {"key": "intervalHours", "type": "int"}, } - def __init__( - self, - *, - enabled: Optional[bool] = None, - interval_hours: Optional[int] = None, - **kwargs - ): + def __init__(self, *, enabled: Optional[bool] = None, interval_hours: Optional[int] = None, **kwargs): """ :keyword enabled: Whether to enable ImageCleaner on AKS cluster. :paramtype enabled: bool @@ -5614,12 +5477,7 @@ class ManagedClusterSecurityProfileNodeRestriction(_serialization.Model): "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - *, - enabled: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, enabled: Optional[bool] = None, **kwargs): """ :keyword enabled: Whether to enable Node Restriction. :paramtype enabled: bool @@ -5639,12 +5497,7 @@ class ManagedClusterSecurityProfileWorkloadIdentity(_serialization.Model): "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - *, - enabled: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, enabled: Optional[bool] = None, **kwargs): """ :keyword enabled: Whether to enable Workload Identity. :paramtype enabled: bool @@ -5665,7 +5518,7 @@ class ManagedClusterServicePrincipalProfile(_serialization.Model): """ _validation = { - 'client_id': {'required': True}, + "client_id": {"required": True}, } _attribute_map = { @@ -5673,13 +5526,7 @@ class ManagedClusterServicePrincipalProfile(_serialization.Model): "secret": {"key": "secret", "type": "str"}, } - def __init__( - self, - *, - client_id: str, - secret: Optional[str] = None, - **kwargs - ): + def __init__(self, *, client_id: str, secret: Optional[str] = None, **kwargs): """ :keyword client_id: The ID for the service principal. Required. :paramtype client_id: str @@ -5767,12 +5614,12 @@ class ManagedClusterSnapshot(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'managed_cluster_properties_read_only': {'readonly': True}, + "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 = { @@ -5784,7 +5631,10 @@ class ManagedClusterSnapshot(TrackedResource): "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"}, + "managed_cluster_properties_read_only": { + "key": "properties.managedClusterPropertiesReadOnly", + "type": "ManagedClusterPropertiesForSnapshot", + }, } def __init__( @@ -5828,7 +5678,7 @@ class ManagedClusterSnapshotListResult(_serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { @@ -5836,12 +5686,7 @@ class ManagedClusterSnapshotListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["_models.ManagedClusterSnapshot"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.ManagedClusterSnapshot"]] = None, **kwargs): """ :keyword value: The list of managed cluster snapshots. :paramtype value: @@ -5917,12 +5762,7 @@ class ManagedClusterStorageProfileBlobCSIDriver(_serialization.Model): "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - *, - enabled: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, enabled: Optional[bool] = None, **kwargs): """ :keyword enabled: Whether to enable AzureBlob CSI Driver. The default value is false. :paramtype enabled: bool @@ -5945,13 +5785,7 @@ class ManagedClusterStorageProfileDiskCSIDriver(_serialization.Model): "version": {"key": "version", "type": "str"}, } - def __init__( - self, - *, - enabled: Optional[bool] = None, - version: Optional[str] = None, - **kwargs - ): + def __init__(self, *, enabled: Optional[bool] = None, version: Optional[str] = None, **kwargs): """ :keyword enabled: Whether to enable AzureDisk CSI Driver. The default value is true. :paramtype enabled: bool @@ -5974,12 +5808,7 @@ class ManagedClusterStorageProfileFileCSIDriver(_serialization.Model): "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - *, - enabled: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, enabled: Optional[bool] = None, **kwargs): """ :keyword enabled: Whether to enable AzureFile CSI Driver. The default value is true. :paramtype enabled: bool @@ -5999,12 +5828,7 @@ class ManagedClusterStorageProfileSnapshotController(_serialization.Model): "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - *, - enabled: Optional[bool] = None, - **kwargs - ): + def __init__(self, *, enabled: Optional[bool] = None, **kwargs): """ :keyword enabled: Whether to enable Snapshot Controller. The default value is true. :paramtype enabled: bool @@ -6036,11 +5860,11 @@ class ManagedClusterUpgradeProfile(_serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'control_plane_profile': {'required': True}, - 'agent_pool_profiles': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "control_plane_profile": {"required": True}, + "agent_pool_profiles": {"required": True}, } _attribute_map = { @@ -6110,7 +5934,7 @@ class ManagedClusterWindowsProfile(_serialization.Model): """ _validation = { - 'admin_username': {'required': True}, + "admin_username": {"required": True}, } _attribute_map = { @@ -6182,14 +6006,19 @@ class ManagedClusterWorkloadAutoScalerProfile(_serialization.Model): _attribute_map = { "keda": {"key": "keda", "type": "ManagedClusterWorkloadAutoScalerProfileKeda"}, - "vertical_pod_autoscaler": {"key": "verticalPodAutoscaler", "type": "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler"}, + "vertical_pod_autoscaler": { + "key": "verticalPodAutoscaler", + "type": "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", + }, } def __init__( self, *, keda: Optional["_models.ManagedClusterWorkloadAutoScalerProfileKeda"] = None, - vertical_pod_autoscaler: Optional["_models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler"] = None, + vertical_pod_autoscaler: Optional[ + "_models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler" + ] = None, **kwargs ): """ @@ -6216,19 +6045,14 @@ class ManagedClusterWorkloadAutoScalerProfileKeda(_serialization.Model): """ _validation = { - 'enabled': {'required': True}, + "enabled": {"required": True}, } _attribute_map = { "enabled": {"key": "enabled", "type": "bool"}, } - def __init__( - self, - *, - enabled: bool, - **kwargs - ): + def __init__(self, *, enabled: bool, **kwargs): """ :keyword enabled: Whether to enable KEDA. Required. :paramtype enabled: bool @@ -6257,9 +6081,9 @@ class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler(_serializatio """ _validation = { - 'enabled': {'required': True}, - 'controlled_values': {'required': True}, - 'update_mode': {'required': True}, + "enabled": {"required": True}, + "controlled_values": {"required": True}, + "update_mode": {"required": True}, } _attribute_map = { @@ -6309,8 +6133,8 @@ class ManagedServiceIdentityUserAssignedIdentitiesValue(_serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { @@ -6318,12 +6142,8 @@ class ManagedServiceIdentityUserAssignedIdentitiesValue(_serialization.Model): "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.principal_id = None self.client_id = None @@ -6410,19 +6230,15 @@ class OperationListResult(_serialization.Model): """ _validation = { - 'value': {'readonly': True}, + "value": {"readonly": True}, } _attribute_map = { "value": {"key": "value", "type": "[OperationValue]"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.value = None @@ -6447,12 +6263,12 @@ class OperationValue(_serialization.Model): """ _validation = { - 'origin': {'readonly': True}, - 'name': {'readonly': True}, - 'operation': {'readonly': True}, - 'resource': {'readonly': True}, - 'description': {'readonly': True}, - 'provider': {'readonly': True}, + "origin": {"readonly": True}, + "name": {"readonly": True}, + "operation": {"readonly": True}, + "resource": {"readonly": True}, + "description": {"readonly": True}, + "provider": {"readonly": True}, } _attribute_map = { @@ -6464,12 +6280,8 @@ class OperationValue(_serialization.Model): "provider": {"key": "display.provider", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.origin = None self.name = None @@ -6498,10 +6310,10 @@ class OSOptionProfile(_serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'os_option_property_list': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "os_option_property_list": {"required": True}, } _attribute_map = { @@ -6511,12 +6323,7 @@ class OSOptionProfile(_serialization.Model): "os_option_property_list": {"key": "properties.osOptionPropertyList", "type": "[OSOptionProperty]"}, } - def __init__( - self, - *, - os_option_property_list: List["_models.OSOptionProperty"], - **kwargs - ): + def __init__(self, *, os_option_property_list: List["_models.OSOptionProperty"], **kwargs): """ :keyword os_option_property_list: The list of OS options. Required. :paramtype os_option_property_list: @@ -6541,8 +6348,8 @@ class OSOptionProperty(_serialization.Model): """ _validation = { - 'os_type': {'required': True}, - 'enable_fips_image': {'required': True}, + "os_type": {"required": True}, + "enable_fips_image": {"required": True}, } _attribute_map = { @@ -6550,13 +6357,7 @@ class OSOptionProperty(_serialization.Model): "enable_fips_image": {"key": "enable-fips-image", "type": "bool"}, } - def __init__( - self, - *, - os_type: str, - enable_fips_image: bool, - **kwargs - ): + def __init__(self, *, os_type: str, enable_fips_image: bool, **kwargs): """ :keyword os_type: The OS type. Required. :paramtype os_type: str @@ -6619,8 +6420,8 @@ class OutboundEnvironmentEndpointCollection(_serialization.Model): """ _validation = { - 'value': {'required': True}, - 'next_link': {'readonly': True}, + "value": {"required": True}, + "next_link": {"readonly": True}, } _attribute_map = { @@ -6628,12 +6429,7 @@ class OutboundEnvironmentEndpointCollection(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: List["_models.OutboundEnvironmentEndpoint"], - **kwargs - ): + def __init__(self, *, value: List["_models.OutboundEnvironmentEndpoint"], **kwargs): """ :keyword value: Collection of resources. Required. :paramtype value: @@ -6656,12 +6452,7 @@ class PowerState(_serialization.Model): "code": {"key": "code", "type": "str"}, } - def __init__( - self, - *, - code: Optional[Union[str, "_models.Code"]] = None, - **kwargs - ): + def __init__(self, *, code: Optional[Union[str, "_models.Code"]] = None, **kwargs): """ :keyword code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and "Stopped". @@ -6682,12 +6473,7 @@ class PrivateEndpoint(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - **kwargs - ): + def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin """ :keyword id: The resource ID of the private endpoint. :paramtype id: str @@ -6707,8 +6493,8 @@ class PrivateEndpointConnection(_serialization.Model): :vartype name: str :ivar type: The resource type. :vartype type: str - :ivar provisioning_state: The current provisioning state. Known values are: "Succeeded", - "Creating", "Deleting", and "Failed". + :ivar provisioning_state: The current provisioning state. Known values are: "Canceled", + "Creating", "Deleting", "Failed", and "Succeeded". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2022_07_02_preview.models.PrivateEndpointConnectionProvisioningState :ivar private_endpoint: The resource of private endpoint. @@ -6721,10 +6507,10 @@ class PrivateEndpointConnection(_serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { @@ -6733,7 +6519,10 @@ class PrivateEndpointConnection(_serialization.Model): "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"}, + "private_link_service_connection_state": { + "key": "properties.privateLinkServiceConnectionState", + "type": "PrivateLinkServiceConnectionState", + }, } def __init__( @@ -6773,12 +6562,7 @@ class PrivateEndpointConnectionListResult(_serialization.Model): "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, } - def __init__( - self, - *, - value: Optional[List["_models.PrivateEndpointConnection"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.PrivateEndpointConnection"]] = None, **kwargs): """ :keyword value: The collection value. :paramtype value: @@ -6809,7 +6593,7 @@ class PrivateLinkResource(_serialization.Model): """ _validation = { - 'private_link_service_id': {'readonly': True}, + "private_link_service_id": {"readonly": True}, } _attribute_map = { @@ -6864,12 +6648,7 @@ class PrivateLinkResourcesListResult(_serialization.Model): "value": {"key": "value", "type": "[PrivateLinkResource]"}, } - def __init__( - self, - *, - value: Optional[List["_models.PrivateLinkResource"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.PrivateLinkResource"]] = None, **kwargs): """ :keyword value: The collection value. :paramtype value: @@ -6926,12 +6705,7 @@ class ResourceReference(_serialization.Model): "id": {"key": "id", "type": "str"}, } - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - **kwargs - ): + def __init__(self, *, id: Optional[str] = None, **kwargs): # pylint: disable=redefined-builtin """ :keyword id: The fully qualified Azure resource id. :paramtype id: str @@ -6954,7 +6728,7 @@ class RunCommandRequest(_serialization.Model): """ _validation = { - 'command': {'required': True}, + "command": {"required": True}, } _attribute_map = { @@ -6963,14 +6737,7 @@ class RunCommandRequest(_serialization.Model): "cluster_token": {"key": "clusterToken", "type": "str"}, } - def __init__( - self, - *, - command: str, - context: Optional[str] = None, - cluster_token: Optional[str] = None, - **kwargs - ): + def __init__(self, *, command: str, context: Optional[str] = None, cluster_token: Optional[str] = None, **kwargs): """ :keyword command: The command to run. Required. :paramtype command: str @@ -7007,13 +6774,13 @@ class RunCommandResult(_serialization.Model): """ _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}, + "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 = { @@ -7026,12 +6793,8 @@ class RunCommandResult(_serialization.Model): "reason": {"key": "properties.reason", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.id = None self.provisioning_state = None @@ -7090,17 +6853,17 @@ class Snapshot(TrackedResource): # pylint: disable=too-many-instance-attributes """ _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}, + "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 = { @@ -7165,7 +6928,7 @@ class SnapshotListResult(_serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { @@ -7173,12 +6936,7 @@ class SnapshotListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["_models.Snapshot"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.Snapshot"]] = None, **kwargs): """ :keyword value: The list of snapshots. :paramtype value: list[~azure.mgmt.containerservice.v2022_07_02_preview.models.Snapshot] @@ -7481,12 +7239,7 @@ class TagsObject(_serialization.Model): "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs): """ :keyword tags: Resource tags. :paramtype tags: dict[str, str] @@ -7513,11 +7266,7 @@ class TimeInWeek(_serialization.Model): } def __init__( - self, - *, - day: Optional[Union[str, "_models.WeekDay"]] = None, - hour_slots: Optional[List[int]] = None, - **kwargs + self, *, day: Optional[Union[str, "_models.WeekDay"]] = None, hour_slots: Optional[List[int]] = None, **kwargs ): """ :keyword day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", @@ -7547,13 +7296,7 @@ class TimeSpan(_serialization.Model): "end": {"key": "end", "type": "iso-8601"}, } - def __init__( - self, - *, - start: Optional[datetime.datetime] = None, - end: Optional[datetime.datetime] = None, - **kwargs - ): + def __init__(self, *, start: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, **kwargs): """ :keyword start: The start of a time span. :paramtype start: ~datetime.datetime @@ -7582,9 +7325,9 @@ class TrustedAccessRole(_serialization.Model): """ _validation = { - 'source_resource_type': {'readonly': True}, - 'name': {'readonly': True}, - 'rules': {'readonly': True}, + "source_resource_type": {"readonly": True}, + "name": {"readonly": True}, + "rules": {"readonly": True}, } _attribute_map = { @@ -7593,12 +7336,8 @@ class TrustedAccessRole(_serialization.Model): "rules": {"key": "rules", "type": "[TrustedAccessRoleRule]"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.source_resource_type = None self.name = None @@ -7624,7 +7363,7 @@ class TrustedAccessRoleBinding(Resource): information. :vartype system_data: ~azure.mgmt.containerservice.v2022_07_02_preview.models.SystemData :ivar provisioning_state: The current provisioning state of trusted access role binding. Known - values are: "Succeeded", "Failed", "Updating", and "Deleting". + values are: "Canceled", "Deleting", "Failed", "Succeeded", and "Updating". :vartype provisioning_state: str or ~azure.mgmt.containerservice.v2022_07_02_preview.models.TrustedAccessRoleBindingProvisioningState :ivar source_resource_id: The ARM resource ID of source resource that trusted access is @@ -7636,13 +7375,13 @@ class TrustedAccessRoleBinding(Resource): """ _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}, + "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 = { @@ -7655,13 +7394,7 @@ class TrustedAccessRoleBinding(Resource): "roles": {"key": "properties.roles", "type": "[str]"}, } - def __init__( - self, - *, - source_resource_id: str, - roles: List[str], - **kwargs - ): + def __init__(self, *, source_resource_id: str, roles: List[str], **kwargs): """ :keyword source_resource_id: The ARM resource ID of source resource that trusted access is configured for. Required. @@ -7689,7 +7422,7 @@ class TrustedAccessRoleBindingListResult(_serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { @@ -7697,12 +7430,7 @@ class TrustedAccessRoleBindingListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - *, - value: Optional[List["_models.TrustedAccessRoleBinding"]] = None, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.TrustedAccessRoleBinding"]] = None, **kwargs): """ :keyword value: Role binding list. :paramtype value: @@ -7725,8 +7453,8 @@ class TrustedAccessRoleListResult(_serialization.Model): """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { @@ -7734,12 +7462,8 @@ class TrustedAccessRoleListResult(_serialization.Model): "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.value = None self.next_link = None @@ -7763,11 +7487,11 @@ class TrustedAccessRoleRule(_serialization.Model): """ _validation = { - 'verbs': {'readonly': True}, - 'api_groups': {'readonly': True}, - 'resources': {'readonly': True}, - 'resource_names': {'readonly': True}, - 'non_resource_ur_ls': {'readonly': True}, + "verbs": {"readonly": True}, + "api_groups": {"readonly": True}, + "resources": {"readonly": True}, + "resource_names": {"readonly": True}, + "non_resource_ur_ls": {"readonly": True}, } _attribute_map = { @@ -7778,12 +7502,8 @@ class TrustedAccessRoleRule(_serialization.Model): "non_resource_ur_ls": {"key": "nonResourceURLs", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): - """ - """ + def __init__(self, **kwargs): + """ """ super().__init__(**kwargs) self.verbs = None self.api_groups = None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_patch.py index 0ad201a8c586..f7dd32510333 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/models/_patch.py @@ -10,6 +10,7 @@ __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. diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/__init__.py index 03d015afec25..d0dc4a5de18e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/__init__.py @@ -23,20 +23,21 @@ from ._patch import __all__ as _patch_all from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk + __all__ = [ - 'Operations', - 'ManagedClustersOperations', - 'MaintenanceConfigurationsOperations', - 'AgentPoolsOperations', - 'PrivateEndpointConnectionsOperations', - 'PrivateLinkResourcesOperations', - 'ResolvePrivateLinkServiceIdOperations', - 'SnapshotsOperations', - 'ManagedClusterSnapshotsOperations', - 'TrustedAccessRolesOperations', - 'TrustedAccessRoleBindingsOperations', - 'FleetsOperations', - 'FleetMembersOperations', + "Operations", + "ManagedClustersOperations", + "MaintenanceConfigurationsOperations", + "AgentPoolsOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "SnapshotsOperations", + "ManagedClusterSnapshotsOperations", + "TrustedAccessRolesOperations", + "TrustedAccessRoleBindingsOperations", + "FleetsOperations", + "FleetMembersOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) -_patch_sdk() \ No newline at end of file +_patch_sdk() 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 c9a69ec40f05..1e40bbe156cc 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 @@ -9,7 +9,14 @@ from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -23,7 +30,8 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -31,160 +39,169 @@ def build_abort_latest_operation_request( - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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"), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="POST", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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"), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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"), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( @@ -199,150 +216,166 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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"), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="DELETE", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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"), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_available_agent_pool_versions_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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"), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="POST", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class AgentPoolsOperations: """ @@ -363,14 +396,9 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def abort_latest_operation( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> None: """Aborts last operation running on agent pool. @@ -393,24 +421,26 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.abort_latest_operation.metadata['url'], + template_url=self.abort_latest_operation.metadata["url"], headers=_headers, params=_params, ) @@ -418,9 +448,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -432,16 +460,10 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - abort_latest_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort"} # type: ignore - + abort_latest_operation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort"} # type: ignore @distributed_trace - def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> Iterable["_models.AgentPool"]: + 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. @@ -460,22 +482,26 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPoolListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -504,9 +530,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -516,19 +540,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> _models.AgentPool: """Gets the specified managed cluster agent pool. @@ -547,24 +565,26 @@ def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPool] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] - 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, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -572,9 +592,7 @@ def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -583,15 +601,14 @@ def get( 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) + deserialized = self._deserialize("AgentPool", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore def _create_or_update_initial( self, @@ -602,16 +619,19 @@ def _create_or_update_initial( **kwargs: Any ) -> _models.AgentPool: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPool] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] content_type = content_type or "application/json" _json = None @@ -619,7 +639,7 @@ def _create_or_update_initial( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'AgentPool') + _json = self._serialize.body(parameters, "AgentPool") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -630,7 +650,7 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) @@ -638,9 +658,7 @@ def _create_or_update_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -650,18 +668,17 @@ def _create_or_update_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('AgentPool', pipeline_response) + deserialized = self._deserialize("AgentPool", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('AgentPool', pipeline_response) + deserialized = self._deserialize("AgentPool", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore @overload def begin_create_or_update( @@ -745,7 +762,6 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def begin_create_or_update( self, @@ -788,15 +804,12 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPool] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( # type: ignore resource_group_name=resource_group_name, @@ -805,39 +818,35 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('AgentPool', pipeline_response) + deserialized = self._deserialize("AgentPool", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -848,17 +857,19 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( resource_group_name=resource_group_name, resource_name=resource_name, @@ -866,7 +877,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements subscription_id=self._config.subscription_id, ignore_pod_disruption_budget=ignore_pod_disruption_budget, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) @@ -874,9 +885,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -888,8 +897,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore @distributed_trace def begin_delete( @@ -929,14 +937,11 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -944,45 +949,37 @@ def begin_delete( agent_pool_name=agent_pool_name, ignore_pod_disruption_budget=ignore_pod_disruption_budget, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore @distributed_trace def get_upgrade_profile( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> _models.AgentPoolUpgradeProfile: """Gets the upgrade profile for an agent pool. @@ -1001,24 +998,26 @@ def get_upgrade_profile( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPoolUpgradeProfile] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolUpgradeProfile] - 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, - template_url=self.get_upgrade_profile.metadata['url'], + template_url=self.get_upgrade_profile.metadata["url"], headers=_headers, params=_params, ) @@ -1026,9 +1025,7 @@ def get_upgrade_profile( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1037,22 +1034,18 @@ def get_upgrade_profile( 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) + deserialized = self._deserialize("AgentPoolUpgradeProfile", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_upgrade_profile.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default"} # type: ignore - + get_upgrade_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default"} # type: ignore @distributed_trace def get_available_agent_pool_versions( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> _models.AgentPoolAvailableVersions: """Gets a list of supported Kubernetes versions for the specified agent pool. @@ -1071,23 +1064,25 @@ def get_available_agent_pool_versions( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.AgentPoolAvailableVersions] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolAvailableVersions] - 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, - template_url=self.get_available_agent_pool_versions.metadata['url'], + template_url=self.get_available_agent_pool_versions.metadata["url"], headers=_headers, params=_params, ) @@ -1095,9 +1090,7 @@ def get_available_agent_pool_versions( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1106,42 +1099,39 @@ def get_available_agent_pool_versions( 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) + deserialized = self._deserialize("AgentPoolAvailableVersions", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_available_agent_pool_versions.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions"} # type: ignore - + get_available_agent_pool_versions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions"} # type: ignore def _upgrade_node_image_version_initial( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> Optional[_models.AgentPool]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.AgentPool]] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AgentPool]] - 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, - template_url=self._upgrade_node_image_version_initial.metadata['url'], + template_url=self._upgrade_node_image_version_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1149,9 +1139,7 @@ def _upgrade_node_image_version_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1163,25 +1151,22 @@ def _upgrade_node_image_version_initial( 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) + 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) return deserialized - _upgrade_node_image_version_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # type: ignore - + _upgrade_node_image_version_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # type: ignore @distributed_trace def begin_upgrade_node_image_version( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any ) -> LROPoller[None]: """Upgrades the node image version of an agent pool to the latest. @@ -1212,54 +1197,49 @@ def begin_upgrade_node_image_version( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._upgrade_node_image_version_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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + 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) + 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) return deserialized - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_upgrade_node_image_version.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # type: ignore + begin_upgrade_node_image_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # type: ignore 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 8005e21209f9..442135df4c5a 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 @@ -9,7 +9,14 @@ from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -23,7 +30,8 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -43,79 +51,91 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, 'str', max_length=63, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), - "fleetMemberName": _SERIALIZER.url("fleet_member_name", fleet_member_name, 'str', max_length=50, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url( + "fleet_name", fleet_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + ), + "fleetMemberName": _SERIALIZER.url( + "fleet_member_name", + fleet_member_name, + "str", + max_length=50, + min_length=1, + pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$", + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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') + _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') + _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 - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( - resource_group_name: str, - fleet_name: str, - fleet_member_name: str, - subscription_id: str, - **kwargs: Any + resource_group_name: str, fleet_name: str, fleet_member_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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, 'str', max_length=63, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), - "fleetMemberName": _SERIALIZER.url("fleet_member_name", fleet_member_name, 'str', max_length=50, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url( + "fleet_name", fleet_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + ), + "fleetMemberName": _SERIALIZER.url( + "fleet_member_name", + fleet_member_name, + "str", + max_length=50, + min_length=1, + pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$", + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( @@ -130,72 +150,79 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, 'str', max_length=63, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), - "fleetMemberName": _SERIALIZER.url("fleet_member_name", fleet_member_name, 'str', max_length=50, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url( + "fleet_name", fleet_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + ), + "fleetMemberName": _SERIALIZER.url( + "fleet_member_name", + fleet_member_name, + "str", + max_length=50, + min_length=1, + pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$", + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _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 - ) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_list_by_fleet_request( - resource_group_name: str, - fleet_name: str, - subscription_id: str, - **kwargs: Any + resource_group_name: str, fleet_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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, 'str', max_length=63, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url( + "fleet_name", fleet_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class FleetMembersOperations: """ @@ -216,7 +243,6 @@ def __init__(self, *args, **kwargs): 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") - def _create_or_update_initial( self, resource_group_name: str, @@ -228,16 +254,19 @@ def _create_or_update_initial( **kwargs: Any ) -> _models.FleetMember: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetMember] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetMember] content_type = content_type or "application/json" _json = None @@ -245,7 +274,7 @@ def _create_or_update_initial( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'FleetMember') + _json = self._serialize.body(parameters, "FleetMember") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -258,7 +287,7 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) @@ -266,9 +295,7 @@ def _create_or_update_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -279,18 +306,17 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('FleetMember', pipeline_response) + deserialized = self._deserialize("FleetMember", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('FleetMember', pipeline_response) + deserialized = self._deserialize("FleetMember", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore @overload def begin_create_or_update( @@ -398,7 +424,6 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def begin_create_or_update( self, @@ -453,15 +478,12 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetMember] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetMember] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( # type: ignore resource_group_name=resource_group_name, @@ -472,47 +494,39 @@ def begin_create_or_update( if_none_match=if_none_match, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('FleetMember', pipeline_response) + deserialized = self._deserialize("FleetMember", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - fleet_name: str, - fleet_member_name: str, - **kwargs: Any + self, resource_group_name: str, fleet_name: str, fleet_member_name: str, **kwargs: Any ) -> _models.FleetMember: """Gets a Fleet member. @@ -531,24 +545,26 @@ def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetMember] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetMember] - request = build_get_request( resource_group_name=resource_group_name, fleet_name=fleet_name, fleet_member_name=fleet_member_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -556,9 +572,7 @@ def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -568,15 +582,14 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('FleetMember', pipeline_response) + deserialized = self._deserialize("FleetMember", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -587,17 +600,19 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( resource_group_name=resource_group_name, fleet_name=fleet_name, @@ -605,7 +620,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) @@ -613,9 +628,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -628,8 +641,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore @distributed_trace def begin_delete( @@ -671,14 +683,11 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, @@ -686,44 +695,39 @@ def begin_delete( fleet_member_name=fleet_member_name, if_match=if_match, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - lro_options={'final-state-via': 'location'}, - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}"} # type: ignore @distributed_trace def list_by_fleet( - self, - resource_group_name: str, - fleet_name: str, - **kwargs: Any + self, resource_group_name: str, fleet_name: str, **kwargs: Any ) -> Iterable["_models.FleetMember"]: """Lists the members of a fleet. @@ -743,22 +747,26 @@ def list_by_fleet( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetMembersListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetMembersListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - + request = build_list_by_fleet_request( resource_group_name=resource_group_name, fleet_name=fleet_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_by_fleet.metadata['url'], + template_url=self.list_by_fleet.metadata["url"], headers=_headers, params=_params, ) @@ -787,9 +795,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -800,8 +806,6 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_fleet.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members"} # type: ignore + list_by_fleet.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members"} # type: ignore 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 e5ac4ce34697..1017f9c132ab 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 @@ -9,7 +9,14 @@ from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -23,7 +30,8 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -42,266 +50,240 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, 'str', max_length=63, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url( + "fleet_name", fleet_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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') + _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') + _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 - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( - resource_group_name: str, - fleet_name: str, - subscription_id: str, - *, - if_match: Optional[str] = None, - **kwargs: Any + resource_group_name: str, fleet_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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, 'str', max_length=63, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url( + "fleet_name", fleet_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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') + _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 - ) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request( - resource_group_name: str, - fleet_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: +def build_get_request(resource_group_name: str, fleet_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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, 'str', max_length=63, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url( + "fleet_name", fleet_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( - resource_group_name: str, - fleet_name: str, - subscription_id: str, - *, - if_match: Optional[str] = None, - **kwargs: Any + resource_group_name: str, fleet_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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, 'str', max_length=63, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url( + "fleet_name", fleet_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _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 - ) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_resource_group_request( - resource_group_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_request( - subscription_id: str, - **kwargs: Any -) -> HttpRequest: +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets") path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_list_credentials_request( - resource_group_name: str, - fleet_name: str, - subscription_id: str, - **kwargs: Any + resource_group_name: str, fleet_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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials") # pylint: disable=line-too-long + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials", + ) # pylint: disable=line-too-long path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "fleetName": _SERIALIZER.url("fleet_name", fleet_name, 'str', max_length=63, min_length=1, pattern=r'^[a-z0-9]([-a-z0-9]*[a-z0-9])?$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "fleetName": _SERIALIZER.url( + "fleet_name", fleet_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="POST", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class FleetsOperations: """ @@ -322,7 +304,6 @@ def __init__(self, *args, **kwargs): 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") - def _create_or_update_initial( self, resource_group_name: str, @@ -333,16 +314,19 @@ def _create_or_update_initial( **kwargs: Any ) -> _models.Fleet: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.Fleet] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Fleet] content_type = content_type or "application/json" _json = None @@ -350,7 +334,7 @@ def _create_or_update_initial( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'Fleet') + _json = self._serialize.body(parameters, "Fleet") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -362,7 +346,7 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) @@ -370,9 +354,7 @@ def _create_or_update_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -383,18 +365,17 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('Fleet', pipeline_response) + deserialized = self._deserialize("Fleet", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Fleet', pipeline_response) + deserialized = self._deserialize("Fleet", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore @overload def begin_create_or_update( @@ -492,7 +473,6 @@ def begin_create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def begin_create_or_update( self, @@ -542,15 +522,12 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.Fleet] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Fleet] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( # type: ignore resource_group_name=resource_group_name, @@ -560,39 +537,35 @@ def begin_create_or_update( if_none_match=if_none_match, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('Fleet', pipeline_response) + deserialized = self._deserialize("Fleet", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore @overload def update( @@ -664,7 +637,6 @@ def update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def update( self, @@ -699,16 +671,19 @@ def update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.Fleet] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Fleet] content_type = content_type or "application/json" _json = None @@ -717,7 +692,7 @@ def update( _content = parameters else: if parameters is not None: - _json = self._serialize.body(parameters, 'FleetPatch') + _json = self._serialize.body(parameters, "FleetPatch") else: _json = None @@ -730,7 +705,7 @@ def update( content_type=content_type, json=_json, content=_content, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], headers=_headers, params=_params, ) @@ -738,9 +713,7 @@ def update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -750,23 +723,17 @@ def update( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('Fleet', pipeline_response) + deserialized = self._deserialize("Fleet", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore @distributed_trace - def get( - self, - resource_group_name: str, - fleet_name: str, - **kwargs: Any - ) -> _models.Fleet: + def get(self, resource_group_name: str, fleet_name: str, **kwargs: Any) -> _models.Fleet: """Gets a Fleet. Gets a Fleet. @@ -782,23 +749,25 @@ def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.Fleet] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.Fleet] - request = build_get_request( resource_group_name=resource_group_name, fleet_name=fleet_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -806,9 +775,7 @@ def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -818,42 +785,39 @@ def get( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('Fleet', pipeline_response) + deserialized = self._deserialize("Fleet", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - fleet_name: str, - if_match: Optional[str] = None, - **kwargs: Any + self, resource_group_name: str, fleet_name: str, if_match: Optional[str] = None, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] - request = build_delete_request( resource_group_name=resource_group_name, fleet_name=fleet_name, subscription_id=self._config.subscription_id, if_match=if_match, api_version=api_version, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) @@ -861,9 +825,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -876,16 +838,11 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore @distributed_trace def begin_delete( - self, - resource_group_name: str, - fleet_name: str, - if_match: Optional[str] = None, - **kwargs: Any + self, resource_group_name: str, fleet_name: str, if_match: Optional[str] = None, **kwargs: Any ) -> LROPoller[None]: """Deletes a Fleet. @@ -915,58 +872,49 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._delete_initial( # type: ignore resource_group_name=resource_group_name, fleet_name=fleet_name, if_match=if_match, api_version=api_version, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - lro_options={'final-state-via': 'location'}, - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}"} # type: ignore @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> Iterable["_models.Fleet"]: + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Fleet"]: """Lists fleets in the specified subscription and resource group. Lists fleets in the specified subscription and resource group. @@ -983,21 +931,25 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) @@ -1026,9 +978,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1039,17 +989,12 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets"} # type: ignore @distributed_trace - def list( - self, - **kwargs: Any - ) -> Iterable["_models.Fleet"]: + def list(self, **kwargs: Any) -> Iterable["_models.Fleet"]: """Lists fleets in the specified subscription. Lists fleets in the specified subscription. @@ -1063,20 +1008,24 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -1105,9 +1054,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1118,18 +1065,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets"} # type: ignore @distributed_trace def list_credentials( - self, - resource_group_name: str, - fleet_name: str, - **kwargs: Any + self, resource_group_name: str, fleet_name: str, **kwargs: Any ) -> _models.FleetCredentialResults: """Lists the user credentials of a Fleet. @@ -1146,23 +1088,25 @@ def list_credentials( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.FleetCredentialResults] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.FleetCredentialResults] - request = build_list_credentials_request( resource_group_name=resource_group_name, fleet_name=fleet_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list_credentials.metadata['url'], + template_url=self.list_credentials.metadata["url"], headers=_headers, params=_params, ) @@ -1170,9 +1114,7 @@ def list_credentials( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1182,12 +1124,11 @@ def list_credentials( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('FleetCredentialResults', pipeline_response) + deserialized = self._deserialize("FleetCredentialResults", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_credentials.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials"} # type: ignore - + list_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials"} # type: ignore 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 3ec60f0d9d82..6a8ed70fb4a6 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 @@ -9,7 +9,14 @@ from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,7 +28,8 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -29,160 +37,170 @@ def build_list_by_managed_cluster_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="DELETE", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class MaintenanceConfigurationsOperations: """ @@ -203,13 +221,9 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def list_by_managed_cluster( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> Iterable["_models.MaintenanceConfiguration"]: """Gets a list of maintenance configurations in the specified managed cluster. @@ -230,22 +244,26 @@ def list_by_managed_cluster( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.MaintenanceConfigurationListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_by_managed_cluster.metadata['url'], + template_url=self.list_by_managed_cluster.metadata["url"], headers=_headers, params=_params, ) @@ -274,9 +292,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -286,19 +302,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_managed_cluster.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations"} # type: ignore + list_by_managed_cluster.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - resource_name: str, - config_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any ) -> _models.MaintenanceConfiguration: """Gets the specified maintenance configuration of a managed cluster. @@ -317,24 +327,26 @@ def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.MaintenanceConfiguration] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfiguration] - 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, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -342,9 +354,7 @@ def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -353,15 +363,14 @@ def get( 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) + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore @overload def create_or_update( @@ -430,7 +439,6 @@ def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def create_or_update( self, @@ -464,16 +472,19 @@ def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.MaintenanceConfiguration] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfiguration] content_type = content_type or "application/json" _json = None @@ -481,7 +492,7 @@ def create_or_update( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'MaintenanceConfiguration') + _json = self._serialize.body(parameters, "MaintenanceConfiguration") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -492,7 +503,7 @@ def create_or_update( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], headers=_headers, params=_params, ) @@ -500,9 +511,7 @@ def create_or_update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -511,23 +520,18 @@ def create_or_update( 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) + deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - config_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any ) -> None: """Deletes a maintenance configuration. @@ -546,24 +550,26 @@ def delete( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], headers=_headers, params=_params, ) @@ -571,9 +577,7 @@ def delete( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -585,5 +589,4 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore 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 f3fc2e76164f..c4015cdb9ef2 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 @@ -9,7 +9,14 @@ from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,233 +28,233 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +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: +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots") # pylint: disable=line-too-long + _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', min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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: +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) - - -def build_get_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: + _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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="DELETE", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class ManagedClusterSnapshotsOperations: """ @@ -268,12 +275,8 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - **kwargs: Any - ) -> Iterable["_models.ManagedClusterSnapshot"]: + 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. @@ -288,20 +291,24 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterSnapshotListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -330,9 +337,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -342,17 +347,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore @distributed_trace def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any + self, resource_group_name: str, **kwargs: Any ) -> Iterable["_models.ManagedClusterSnapshot"]: """Lists managed cluster snapshots in the specified subscription and resource group. @@ -371,21 +372,25 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterSnapshotListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) @@ -414,9 +419,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -426,19 +429,12 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore @distributed_trace - def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: + def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedClusterSnapshot: """Gets a managed cluster snapshot. Gets a managed cluster snapshot. @@ -454,23 +450,25 @@ def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterSnapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] - request = build_get_request( resource_group_name=resource_group_name, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -478,9 +476,7 @@ def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -489,15 +485,14 @@ def get( 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) + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore @overload def create_or_update( @@ -560,7 +555,6 @@ def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def create_or_update( self, @@ -591,16 +585,19 @@ def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterSnapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] content_type = content_type or "application/json" _json = None @@ -608,7 +605,7 @@ def create_or_update( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'ManagedClusterSnapshot') + _json = self._serialize.body(parameters, "ManagedClusterSnapshot") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -618,7 +615,7 @@ def create_or_update( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], headers=_headers, params=_params, ) @@ -626,9 +623,7 @@ def create_or_update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -638,18 +633,17 @@ def create_or_update( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('ManagedClusterSnapshot', pipeline_response) + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ManagedClusterSnapshot', pipeline_response) + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore @overload def update_tags( @@ -713,14 +707,9 @@ def update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedClusterSnapshot: """Updates tags on a managed cluster snapshot. @@ -743,16 +732,19 @@ def update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterSnapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] content_type = content_type or "application/json" _json = None @@ -760,7 +752,7 @@ def update_tags( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'TagsObject') + _json = self._serialize.body(parameters, "TagsObject") request = build_update_tags_request( resource_group_name=resource_group_name, @@ -770,7 +762,7 @@ def update_tags( content_type=content_type, json=_json, content=_content, - template_url=self.update_tags.metadata['url'], + template_url=self.update_tags.metadata["url"], headers=_headers, params=_params, ) @@ -778,9 +770,7 @@ def update_tags( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -789,22 +779,18 @@ def update_tags( 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) + deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore - + update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: """Deletes a managed cluster snapshot. @@ -821,23 +807,25 @@ def delete( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], headers=_headers, params=_params, ) @@ -845,9 +833,7 @@ def delete( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -859,5 +845,4 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore 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 b0f3af905197..e748b3ead299 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 @@ -9,7 +9,14 @@ from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -23,7 +30,8 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -31,186 +39,172 @@ def build_get_os_options_request( - location: str, - subscription_id: str, - *, - resource_type: Optional[str] = None, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "location": _SERIALIZER.url("location", location, "str", min_length=1), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + _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: + +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters") + _url = kwargs.pop( + "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters" + ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _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: + +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _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( @@ -224,34 +218,40 @@ def build_list_cluster_admin_credentials_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + _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( @@ -266,36 +266,42 @@ def build_list_cluster_user_credentials_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") if format is not None: - _params['format'] = _SERIALIZER.query("format", format, 'str') + _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 - ) + _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( @@ -309,151 +315,164 @@ def build_list_cluster_monitoring_user_credentials_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + _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: + +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _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( @@ -467,415 +486,453 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + _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( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_rotate_cluster_certificates_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _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( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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 - ) + _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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _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( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + _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 """ @@ -896,13 +953,9 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def get_os_options( - self, - location: str, - resource_type: Optional[str] = None, - **kwargs: Any + self, location: str, resource_type: Optional[str] = None, **kwargs: Any ) -> _models.OSOptionProfile: """Gets supported OS options in the specified subscription. @@ -919,23 +972,25 @@ def get_os_options( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.OSOptionProfile] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OSOptionProfile] - request = build_get_os_options_request( location=location, subscription_id=self._config.subscription_id, resource_type=resource_type, api_version=api_version, - template_url=self.get_os_options.metadata['url'], + template_url=self.get_os_options.metadata["url"], headers=_headers, params=_params, ) @@ -943,9 +998,7 @@ def get_os_options( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -954,21 +1007,17 @@ def get_os_options( 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) + deserialized = self._deserialize("OSOptionProfile", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_os_options.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default"} # type: ignore - + get_os_options.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default"} # type: ignore @distributed_trace - def list( - self, - **kwargs: Any - ) -> Iterable["_models.ManagedCluster"]: + 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. @@ -982,20 +1031,24 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -1024,9 +1077,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1036,18 +1087,12 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> Iterable["_models.ManagedCluster"]: + 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. @@ -1064,21 +1109,25 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) @@ -1107,9 +1156,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1119,18 +1166,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore @distributed_trace def get_upgrade_profile( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> _models.ManagedClusterUpgradeProfile: """Gets the upgrade profile of a managed cluster. @@ -1147,23 +1189,25 @@ def get_upgrade_profile( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterUpgradeProfile] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterUpgradeProfile] - 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, - template_url=self.get_upgrade_profile.metadata['url'], + template_url=self.get_upgrade_profile.metadata["url"], headers=_headers, params=_params, ) @@ -1171,9 +1215,7 @@ def get_upgrade_profile( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1182,23 +1224,18 @@ def get_upgrade_profile( 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) + deserialized = self._deserialize("ManagedClusterUpgradeProfile", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_upgrade_profile.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default"} # type: ignore - + get_upgrade_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default"} # type: ignore @distributed_trace def get_access_profile( - self, - resource_group_name: str, - resource_name: str, - role_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any ) -> _models.ManagedClusterAccessProfile: """Gets an access profile of a managed cluster. @@ -1220,24 +1257,26 @@ def get_access_profile( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedClusterAccessProfile] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterAccessProfile] - 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, - template_url=self.get_access_profile.metadata['url'], + template_url=self.get_access_profile.metadata["url"], headers=_headers, params=_params, ) @@ -1245,9 +1284,7 @@ def get_access_profile( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1256,23 +1293,18 @@ def get_access_profile( 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) + deserialized = self._deserialize("ManagedClusterAccessProfile", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_access_profile.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential"} # type: ignore - + get_access_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential"} # type: ignore @distributed_trace def list_cluster_admin_credentials( - self, - resource_group_name: str, - resource_name: str, - server_fqdn: Optional[str] = None, - **kwargs: Any + 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. @@ -1291,24 +1323,26 @@ def list_cluster_admin_credentials( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.CredentialResults] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] - 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, - template_url=self.list_cluster_admin_credentials.metadata['url'], + template_url=self.list_cluster_admin_credentials.metadata["url"], headers=_headers, params=_params, ) @@ -1316,9 +1350,7 @@ def list_cluster_admin_credentials( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1327,15 +1359,14 @@ def list_cluster_admin_credentials( 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) + deserialized = self._deserialize("CredentialResults", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_cluster_admin_credentials.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential"} # type: ignore - + list_cluster_admin_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential"} # type: ignore @distributed_trace def list_cluster_user_credentials( @@ -1368,17 +1399,19 @@ def list_cluster_user_credentials( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.CredentialResults] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] - request = build_list_cluster_user_credentials_request( resource_group_name=resource_group_name, resource_name=resource_name, @@ -1386,7 +1419,7 @@ def list_cluster_user_credentials( server_fqdn=server_fqdn, format=format, api_version=api_version, - template_url=self.list_cluster_user_credentials.metadata['url'], + template_url=self.list_cluster_user_credentials.metadata["url"], headers=_headers, params=_params, ) @@ -1394,9 +1427,7 @@ def list_cluster_user_credentials( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1405,23 +1436,18 @@ def list_cluster_user_credentials( 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) + deserialized = self._deserialize("CredentialResults", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_cluster_user_credentials.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential"} # type: ignore - + list_cluster_user_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential"} # 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 + 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. @@ -1440,24 +1466,26 @@ def list_cluster_monitoring_user_credentials( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.CredentialResults] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] - 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, - template_url=self.list_cluster_monitoring_user_credentials.metadata['url'], + template_url=self.list_cluster_monitoring_user_credentials.metadata["url"], headers=_headers, params=_params, ) @@ -1465,9 +1493,7 @@ def list_cluster_monitoring_user_credentials( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1476,23 +1502,17 @@ def list_cluster_monitoring_user_credentials( 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) + deserialized = self._deserialize("CredentialResults", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_cluster_monitoring_user_credentials.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential"} # type: ignore - + list_cluster_monitoring_user_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential"} # type: ignore @distributed_trace - def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> _models.ManagedCluster: + def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: """Gets a managed cluster. Gets a managed cluster. @@ -1508,23 +1528,25 @@ def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedCluster] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] - request = build_get_request( resource_group_name=resource_group_name, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -1532,9 +1554,7 @@ def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1543,34 +1563,32 @@ def get( 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) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedCluster, IO], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> _models.ManagedCluster: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedCluster] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] content_type = content_type or "application/json" _json = None @@ -1578,7 +1596,7 @@ def _create_or_update_initial( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'ManagedCluster') + _json = self._serialize.body(parameters, "ManagedCluster") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -1588,7 +1606,7 @@ def _create_or_update_initial( content_type=content_type, json=_json, content=_content, - template_url=self._create_or_update_initial.metadata['url'], + template_url=self._create_or_update_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1596,9 +1614,7 @@ def _create_or_update_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1608,18 +1624,17 @@ def _create_or_update_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('ManagedCluster', pipeline_response) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('ManagedCluster', pipeline_response) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore - + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore @overload def begin_create_or_update( @@ -1699,14 +1714,9 @@ def begin_create_or_update( :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], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any ) -> LROPoller[_models.ManagedCluster]: """Creates or updates a managed cluster. @@ -1740,15 +1750,12 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedCluster] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._create_or_update_initial( # type: ignore resource_group_name=resource_group_name, @@ -1756,58 +1763,53 @@ def begin_create_or_update( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ManagedCluster', pipeline_response) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore def _update_tags_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.ManagedCluster: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedCluster] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] content_type = content_type or "application/json" _json = None @@ -1815,7 +1817,7 @@ def _update_tags_initial( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'TagsObject') + _json = self._serialize.body(parameters, "TagsObject") request = build_update_tags_request( resource_group_name=resource_group_name, @@ -1825,7 +1827,7 @@ def _update_tags_initial( content_type=content_type, json=_json, content=_content, - template_url=self._update_tags_initial.metadata['url'], + template_url=self._update_tags_initial.metadata["url"], headers=_headers, params=_params, ) @@ -1833,9 +1835,7 @@ def _update_tags_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -1844,15 +1844,14 @@ def _update_tags_initial( 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) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - _update_tags_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore - + _update_tags_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore @overload def begin_update_tags( @@ -1932,14 +1931,9 @@ def begin_update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def begin_update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> LROPoller[_models.ManagedCluster]: """Updates tags on a managed cluster. @@ -1973,15 +1967,12 @@ def begin_update_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.ManagedCluster] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._update_tags_initial( # type: ignore resource_group_name=resource_group_name, @@ -1989,39 +1980,35 @@ def begin_update_tags( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('ManagedCluster', pipeline_response) + deserialized = self._deserialize("ManagedCluster", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore + begin_update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore def _delete_initial( # pylint: disable=inconsistent-return-statements self, @@ -2031,24 +2018,26 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2056,9 +2045,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2070,8 +2057,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore @distributed_trace def begin_delete( @@ -2108,51 +2094,44 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-return-statements self, @@ -2162,16 +2141,19 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] content_type = content_type or "application/json" _json = None @@ -2179,7 +2161,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'ManagedClusterServicePrincipalProfile') + _json = self._serialize.body(parameters, "ManagedClusterServicePrincipalProfile") request = build_reset_service_principal_profile_request( resource_group_name=resource_group_name, @@ -2189,7 +2171,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re content_type=content_type, json=_json, content=_content, - template_url=self._reset_service_principal_profile_initial.metadata['url'], + template_url=self._reset_service_principal_profile_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2197,9 +2179,7 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2208,11 +2188,14 @@ def _reset_service_principal_profile_initial( # pylint: disable=inconsistent-re 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _reset_service_principal_profile_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _reset_service_principal_profile_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # type: ignore @overload def begin_reset_service_principal_profile( @@ -2289,7 +2272,6 @@ def begin_reset_service_principal_profile( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def begin_reset_service_principal_profile( self, @@ -2330,15 +2312,12 @@ def begin_reset_service_principal_profile( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._reset_service_principal_profile_initial( # type: ignore resource_group_name=resource_group_name, @@ -2346,37 +2325,33 @@ def begin_reset_service_principal_profile( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_reset_service_principal_profile.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # type: ignore + begin_reset_service_principal_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # type: ignore def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statements self, @@ -2386,16 +2361,19 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] content_type = content_type or "application/json" _json = None @@ -2403,7 +2381,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'ManagedClusterAADProfile') + _json = self._serialize.body(parameters, "ManagedClusterAADProfile") request = build_reset_aad_profile_request( resource_group_name=resource_group_name, @@ -2413,7 +2391,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement content_type=content_type, json=_json, content=_content, - template_url=self._reset_aad_profile_initial.metadata['url'], + template_url=self._reset_aad_profile_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2421,9 +2399,7 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2432,11 +2408,14 @@ def _reset_aad_profile_initial( # pylint: disable=inconsistent-return-statement 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _reset_aad_profile_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _reset_aad_profile_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # type: ignore @overload def begin_reset_aad_profile( @@ -2513,7 +2492,6 @@ def begin_reset_aad_profile( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def begin_reset_aad_profile( self, @@ -2553,15 +2531,12 @@ def begin_reset_aad_profile( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._reset_aad_profile_initial( # type: ignore resource_group_name=resource_group_name, @@ -2569,44 +2544,37 @@ def begin_reset_aad_profile( parameters=parameters, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_reset_aad_profile.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # type: ignore + begin_reset_aad_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # type: ignore @distributed_trace def abort_latest_operation( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: """Aborts last operation running on managed cluster. @@ -2627,23 +2595,25 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.abort_latest_operation.metadata['url'], + template_url=self.abort_latest_operation.metadata["url"], headers=_headers, params=_params, ) @@ -2651,9 +2621,7 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2665,33 +2633,31 @@ def abort_latest_operation( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - abort_latest_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort"} # type: ignore - + abort_latest_operation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort"} # type: ignore def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._rotate_cluster_certificates_initial.metadata['url'], + template_url=self._rotate_cluster_certificates_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2699,9 +2665,7 @@ def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2710,18 +2674,18 @@ def _rotate_cluster_certificates_initial( # pylint: disable=inconsistent-return 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _rotate_cluster_certificates_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _rotate_cluster_certificates_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # type: ignore @distributed_trace def begin_rotate_cluster_certificates( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> LROPoller[None]: """Rotates the certificates of a managed cluster. @@ -2748,75 +2712,67 @@ def begin_rotate_cluster_certificates( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_rotate_cluster_certificates.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # type: ignore + begin_rotate_cluster_certificates.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # type: ignore def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._rotate_service_account_signing_keys_initial.metadata['url'], + template_url=self._rotate_service_account_signing_keys_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2824,9 +2780,7 @@ def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsisten request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2835,18 +2789,18 @@ def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsisten 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _rotate_service_account_signing_keys_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _rotate_service_account_signing_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore @distributed_trace def begin_rotate_service_account_signing_keys( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> LROPoller[None]: """Rotates the service account signing keys of a managed cluster. @@ -2872,75 +2826,67 @@ def begin_rotate_service_account_signing_keys( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_rotate_service_account_signing_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore + begin_rotate_service_account_signing_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore def _stop_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._stop_initial.metadata['url'], + template_url=self._stop_initial.metadata["url"], headers=_headers, params=_params, ) @@ -2948,9 +2894,7 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -2959,19 +2903,17 @@ def _stop_initial( # pylint: disable=inconsistent-return-statements 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _stop_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # type: ignore @distributed_trace - def begin_stop( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> LROPoller[None]: + 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 @@ -3000,75 +2942,67 @@ def begin_stop( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_stop.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # type: ignore + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # type: ignore def _start_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._start_initial.metadata['url'], + template_url=self._start_initial.metadata["url"], headers=_headers, params=_params, ) @@ -3076,9 +3010,7 @@ def _start_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3087,19 +3019,17 @@ def _start_initial( # pylint: disable=inconsistent-return-statements 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, {}) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - _start_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # type: ignore + if cls: + return cls(pipeline_response, None, response_headers) + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # type: ignore @distributed_trace - def begin_start( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> LROPoller[None]: + 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 @@ -3125,50 +3055,43 @@ def begin_start( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_start.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # type: ignore + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # type: ignore def _run_command_initial( self, @@ -3178,16 +3101,19 @@ def _run_command_initial( **kwargs: Any ) -> Optional[_models.RunCommandResult]: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.RunCommandResult]] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] content_type = content_type or "application/json" _json = None @@ -3195,7 +3121,7 @@ def _run_command_initial( if isinstance(request_payload, (IO, bytes)): _content = request_payload else: - _json = self._serialize.body(request_payload, 'RunCommandRequest') + _json = self._serialize.body(request_payload, "RunCommandRequest") request = build_run_command_request( resource_group_name=resource_group_name, @@ -3205,7 +3131,7 @@ def _run_command_initial( content_type=content_type, json=_json, content=_content, - template_url=self._run_command_initial.metadata['url'], + template_url=self._run_command_initial.metadata["url"], headers=_headers, params=_params, ) @@ -3213,9 +3139,7 @@ def _run_command_initial( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3225,16 +3149,19 @@ def _run_command_initial( raise HttpResponseError(response=response, error_format=ARMErrorFormat) deserialized = None + response_headers = {} if response.status_code == 200: - deserialized = self._deserialize('RunCommandResult', pipeline_response) + 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, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized - _run_command_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # type: ignore - + _run_command_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # type: ignore @overload def begin_run_command( @@ -3319,7 +3246,6 @@ def begin_run_command( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def begin_run_command( self, @@ -3362,15 +3288,12 @@ def begin_run_command( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.RunCommandResult] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] if cont_token is None: raw_result = self._run_command_initial( # type: ignore resource_group_name=resource_group_name, @@ -3378,47 +3301,39 @@ def begin_run_command( request_payload=request_payload, api_version=api_version, content_type=content_type, - cls=lambda x,y,z: x, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize('RunCommandResult', pipeline_response) + deserialized = self._deserialize("RunCommandResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_run_command.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # type: ignore + begin_run_command.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # type: ignore @distributed_trace def get_command_result( - self, - resource_group_name: str, - resource_name: str, - command_id: str, - **kwargs: Any + 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. @@ -3437,24 +3352,26 @@ def get_command_result( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[Optional[_models.RunCommandResult]] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] - 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, - template_url=self.get_command_result.metadata['url'], + template_url=self.get_command_result.metadata["url"], headers=_headers, params=_params, ) @@ -3462,9 +3379,7 @@ def get_command_result( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3475,22 +3390,18 @@ def get_command_result( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('RunCommandResult', pipeline_response) + deserialized = self._deserialize("RunCommandResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get_command_result.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}"} # type: ignore - + get_command_result.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}"} # type: ignore @distributed_trace def list_outbound_network_dependencies_endpoints( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + 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. @@ -3513,22 +3424,26 @@ def list_outbound_network_dependencies_endpoints( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_outbound_network_dependencies_endpoints.metadata['url'], + template_url=self.list_outbound_network_dependencies_endpoints.metadata["url"], headers=_headers, params=_params, ) @@ -3557,9 +3472,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -3569,8 +3482,6 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_outbound_network_dependencies_endpoints.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints"} # type: ignore + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints"} # type: ignore 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 858dab6d7a43..f650f213dae5 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 @@ -9,7 +9,14 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,38 +28,32 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request -T = TypeVar('T') + +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: +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class Operations: """ @@ -73,12 +74,8 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - **kwargs: Any - ) -> Iterable["_models.OperationValue"]: + def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: """Gets a list of operations. Gets a list of operations. @@ -92,19 +89,23 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.OperationListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -133,9 +134,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -145,8 +144,6 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/providers/Microsoft.ContainerService/operations"} # type: ignore + list.metadata = {"url": "/providers/Microsoft.ContainerService/operations"} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_patch.py index 0ad201a8c586..f7dd32510333 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_07_02_preview/operations/_patch.py @@ -10,6 +10,7 @@ __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. 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 2b53adc8bff0..f20dd6856832 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 @@ -8,7 +8,14 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,7 +28,8 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -29,40 +37,43 @@ def build_list_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( @@ -75,33 +86,41 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( @@ -114,36 +133,44 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( @@ -156,33 +183,42 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="DELETE", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class PrivateEndpointConnectionsOperations: """ @@ -203,13 +239,9 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> _models.PrivateEndpointConnectionListResult: """Gets a list of private endpoint connections in the specified managed cluster. @@ -228,23 +260,25 @@ def list( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] - request = build_list_request( resource_group_name=resource_group_name, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -252,9 +286,7 @@ def list( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -263,23 +295,18 @@ def list( 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) + deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> _models.PrivateEndpointConnection: """Gets the specified private endpoint connection. @@ -299,24 +326,26 @@ def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnection] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] - 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, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -324,9 +353,7 @@ def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -335,15 +362,14 @@ def get( 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) + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @overload def update( @@ -412,7 +438,6 @@ def update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def update( self, @@ -446,16 +471,19 @@ def update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateEndpointConnection] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] content_type = content_type or "application/json" _json = None @@ -463,7 +491,7 @@ def update( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'PrivateEndpointConnection') + _json = self._serialize.body(parameters, "PrivateEndpointConnection") request = build_update_request( resource_group_name=resource_group_name, @@ -474,7 +502,7 @@ def update( content_type=content_type, json=_json, content=_content, - template_url=self.update.metadata['url'], + template_url=self.update.metadata["url"], headers=_headers, params=_params, ) @@ -482,9 +510,7 @@ def update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -493,42 +519,39 @@ def update( 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) + deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # 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 + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> None: error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self._delete_initial.metadata['url'], + template_url=self._delete_initial.metadata["url"], headers=_headers, params=_params, ) @@ -536,9 +559,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -550,16 +571,11 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def begin_delete( - self, - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any ) -> LROPoller[None]: """Deletes a private endpoint connection. @@ -587,48 +603,41 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] 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, + cls=lambda x, y, z: x, headers=_headers, params=_params, **kwargs ) - kwargs.pop('error_map', None) + kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - if polling is True: - polling_method = cast(PollingMethod, ARMPolling( - lro_delay, - - - **kwargs - )) # type: PollingMethod - elif polling is False: polling_method = cast(PollingMethod, NoPolling()) - else: polling_method = polling + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling if cont_token: return LROPoller.from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output + deserialization_callback=get_long_running_output, ) return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore 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 3a60205bea45..8605cf8d53e5 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 @@ -8,7 +8,14 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Optional, TypeVar -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -19,7 +26,8 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -27,40 +35,44 @@ def build_list_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class PrivateLinkResourcesOperations: """ @@ -81,13 +93,9 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> _models.PrivateLinkResourcesListResult: """Gets a list of private link resources in the specified managed cluster. @@ -105,23 +113,25 @@ def list( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateLinkResourcesListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourcesListResult] - request = build_list_request( resource_group_name=resource_group_name, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -129,9 +139,7 @@ def list( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -140,12 +148,11 @@ def list( 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) + deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources"} # type: ignore - + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources"} # type: ignore 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 2c7f8e493981..7677c2e5a8f9 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 @@ -8,7 +8,14 @@ # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -19,7 +26,8 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -27,43 +35,47 @@ def build_post_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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) - return HttpRequest( - method="POST", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class ResolvePrivateLinkServiceIdOperations: """ @@ -84,7 +96,6 @@ def __init__(self, *args, **kwargs): 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") - @overload def post( self, @@ -145,7 +156,6 @@ def post( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def post( self, @@ -176,16 +186,19 @@ def post( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.PrivateLinkResource] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResource] content_type = content_type or "application/json" _json = None @@ -193,7 +206,7 @@ def post( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'PrivateLinkResource') + _json = self._serialize.body(parameters, "PrivateLinkResource") request = build_post_request( resource_group_name=resource_group_name, @@ -203,7 +216,7 @@ def post( content_type=content_type, json=_json, content=_content, - template_url=self.post.metadata['url'], + template_url=self.post.metadata["url"], headers=_headers, params=_params, ) @@ -211,9 +224,7 @@ def post( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -222,12 +233,11 @@ def post( 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) + deserialized = self._deserialize("PrivateLinkResource", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - post.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId"} # type: ignore - + post.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId"} # type: ignore 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 bc677c534f67..6e0cced99136 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 @@ -9,7 +9,14 @@ from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,233 +28,231 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +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: +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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', min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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: +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) - - -def build_get_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: + _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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + 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 + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="DELETE", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class SnapshotsOperations: """ @@ -268,12 +273,8 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - **kwargs: Any - ) -> Iterable["_models.Snapshot"]: + 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. @@ -287,20 +288,24 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -329,9 +334,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -341,18 +344,12 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots"} # type: ignore @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> Iterable["_models.Snapshot"]: + 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. @@ -369,21 +366,25 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.SnapshotListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list_by_resource_group.metadata['url'], + template_url=self.list_by_resource_group.metadata["url"], headers=_headers, params=_params, ) @@ -412,9 +413,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -424,19 +423,12 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots"} # type: ignore + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots"} # type: ignore @distributed_trace - def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any - ) -> _models.Snapshot: + def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.Snapshot: """Gets a snapshot. Gets a snapshot. @@ -452,23 +444,25 @@ def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] - request = build_get_request( resource_group_name=resource_group_name, resource_name=resource_name, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -476,9 +470,7 @@ def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -487,15 +479,14 @@ def get( 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) + deserialized = self._deserialize("Snapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore @overload def create_or_update( @@ -557,14 +548,9 @@ def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.Snapshot, IO], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.Snapshot, IO], **kwargs: Any ) -> _models.Snapshot: """Creates or updates a snapshot. @@ -587,16 +573,19 @@ def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] content_type = content_type or "application/json" _json = None @@ -604,7 +593,7 @@ def create_or_update( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'Snapshot') + _json = self._serialize.body(parameters, "Snapshot") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -614,7 +603,7 @@ def create_or_update( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], headers=_headers, params=_params, ) @@ -622,9 +611,7 @@ def create_or_update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -634,18 +621,17 @@ def create_or_update( raise HttpResponseError(response=response, error_format=ARMErrorFormat) if response.status_code == 200: - deserialized = self._deserialize('Snapshot', pipeline_response) + deserialized = self._deserialize("Snapshot", pipeline_response) if response.status_code == 201: - deserialized = self._deserialize('Snapshot', pipeline_response) + deserialized = self._deserialize("Snapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore @overload def update_tags( @@ -707,14 +693,9 @@ def update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO], - **kwargs: Any + self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any ) -> _models.Snapshot: """Updates tags on a snapshot. @@ -737,16 +718,19 @@ def update_tags( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.Snapshot] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] content_type = content_type or "application/json" _json = None @@ -754,7 +738,7 @@ def update_tags( if isinstance(parameters, (IO, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, 'TagsObject') + _json = self._serialize.body(parameters, "TagsObject") request = build_update_tags_request( resource_group_name=resource_group_name, @@ -764,7 +748,7 @@ def update_tags( content_type=content_type, json=_json, content=_content, - template_url=self.update_tags.metadata['url'], + template_url=self.update_tags.metadata["url"], headers=_headers, params=_params, ) @@ -772,9 +756,7 @@ def update_tags( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -783,22 +765,18 @@ def update_tags( 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) + deserialized = self._deserialize("Snapshot", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore - + update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> None: """Deletes a snapshot. @@ -815,23 +793,25 @@ def delete( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], headers=_headers, params=_params, ) @@ -839,9 +819,7 @@ def delete( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -853,5 +831,4 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore 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 78e4680b33da..8d5c3e93d0bd 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 @@ -9,7 +9,14 @@ from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,7 +28,8 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] _SERIALIZER = Serializer() @@ -29,40 +37,43 @@ def build_list_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - **kwargs: Any + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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]$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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 = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( @@ -75,33 +86,41 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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=36, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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=36, min_length=1 + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_create_or_update_request( @@ -114,36 +133,44 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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 + _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', min_length=1), - "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=36, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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=36, min_length=1 + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _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') + _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 - ) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_delete_request( @@ -156,33 +183,42 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "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=36, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "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=36, min_length=1 + ), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="DELETE", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class TrustedAccessRoleBindingsOperations: """ @@ -203,13 +239,9 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, **kwargs: Any ) -> Iterable["_models.TrustedAccessRoleBinding"]: """List trusted access role bindings. @@ -230,22 +262,26 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -274,9 +310,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -286,19 +320,13 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings"} # type: ignore @distributed_trace def get( - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> _models.TrustedAccessRoleBinding: """Get a trusted access role binding. @@ -317,24 +345,26 @@ def get( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.TrustedAccessRoleBinding] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBinding] - 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, - template_url=self.get.metadata['url'], + template_url=self.get.metadata["url"], headers=_headers, params=_params, ) @@ -342,9 +372,7 @@ def get( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -353,15 +381,14 @@ def get( 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) + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore - + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore @overload def create_or_update( @@ -430,7 +457,6 @@ def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ - @distributed_trace def create_or_update( self, @@ -464,16 +490,19 @@ def create_or_update( :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - content_type = kwargs.pop('content_type', _headers.pop('Content-Type', None)) # type: Optional[str] - cls = kwargs.pop('cls', None) # type: ClsType[_models.TrustedAccessRoleBinding] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBinding] content_type = content_type or "application/json" _json = None @@ -481,7 +510,7 @@ def create_or_update( if isinstance(trusted_access_role_binding, (IO, bytes)): _content = trusted_access_role_binding else: - _json = self._serialize.body(trusted_access_role_binding, 'TrustedAccessRoleBinding') + _json = self._serialize.body(trusted_access_role_binding, "TrustedAccessRoleBinding") request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -492,7 +521,7 @@ def create_or_update( content_type=content_type, json=_json, content=_content, - template_url=self.create_or_update.metadata['url'], + template_url=self.create_or_update.metadata["url"], headers=_headers, params=_params, ) @@ -500,9 +529,7 @@ def create_or_update( request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -511,23 +538,18 @@ def create_or_update( 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) + deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore - + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore @distributed_trace def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - **kwargs: Any + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any ) -> None: """Delete a trusted access role binding. @@ -546,24 +568,26 @@ def delete( # pylint: disable=inconsistent-return-statements :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + error_map.update(kwargs.pop("error_map", {}) or {}) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[None] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, - template_url=self.delete.metadata['url'], + template_url=self.delete.metadata["url"], headers=_headers, params=_params, ) @@ -571,9 +595,7 @@ def delete( # pylint: disable=inconsistent-return-statements request.url = self._client.format_url(request.url) # type: ignore pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -585,5 +607,4 @@ def delete( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore - + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore 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 0801885607f7..f421a86c85cb 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 @@ -9,7 +9,14 @@ from typing import Any, Callable, Dict, Iterable, Optional, TypeVar from urllib.parse import parse_qs, urljoin, urlparse -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +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 @@ -21,46 +28,41 @@ from .. import models as _models from ..._serialization import Serializer from .._vendor import _convert_request, _format_url_section -T = TypeVar('T') + +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: +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 = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - accept = _headers.pop('Accept', "application/json") + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + 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 + _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', min_length=1), - "location": _SERIALIZER.url("location", location, 'str', min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "location": _SERIALIZER.url("location", location, "str", min_length=1), } _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - _params['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - return HttpRequest( - method="GET", - url=_url, - params=_params, - headers=_headers, - **kwargs - ) class TrustedAccessRolesOperations: """ @@ -81,13 +83,8 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( - self, - location: str, - **kwargs: Any - ) -> Iterable["_models.TrustedAccessRole"]: + def list(self, location: str, **kwargs: Any) -> Iterable["_models.TrustedAccessRole"]: """List supported trusted access roles. List supported trusted access roles. @@ -103,21 +100,25 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version = kwargs.pop('api_version', _params.pop('api-version', "2022-07-02-preview")) # type: str - cls = kwargs.pop('cls', None) # type: ClsType[_models.TrustedAccessRoleListResult] + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-07-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleListResult] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {}) or {}) + 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, - template_url=self.list.metadata['url'], + template_url=self.list.metadata["url"], headers=_headers, params=_params, ) @@ -146,9 +147,7 @@ def get_next(next_link=None): request = prepare_request(next_link) pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access - request, - stream=False, - **kwargs + request, stream=False, **kwargs ) response = pipeline_response.http_response @@ -158,8 +157,6 @@ def get_next(next_link=None): return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles"} # type: ignore + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles"} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/__init__.py new file mode 100644 index 000000000000..a88d6dee97f8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/__init__.py @@ -0,0 +1,24 @@ +# 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 * # type: ignore # 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/v2022_08_02_preview/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_configuration.py new file mode 100644 index 000000000000..c74ee74f6e43 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_configuration.py @@ -0,0 +1,69 @@ +# 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.configuration import Configuration +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(Configuration): # pylint: disable=too-many-instance-attributes + """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. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-08-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: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2022-08-02-preview") # type: str + + 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._configure(**kwargs) + + def _configure( + self, **kwargs # type: Any + ): + # type: (...) -> 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.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**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.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/v2022_08_02_preview/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_container_service_client.py new file mode 100644 index 000000000000..fd2e6174a1e9 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_container_service_client.py @@ -0,0 +1,162 @@ +# 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.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient + +from . import models +from .._serialization import Deserializer, Serializer +from ._configuration import ContainerServiceClientConfiguration +from .operations import ( + AgentPoolsOperations, + MaintenanceConfigurationsOperations, + ManagedClusterSnapshotsOperations, + ManagedClustersOperations, + 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.v2022_08_02_preview.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: + azure.mgmt.containerservice.v2022_08_02_preview.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2022_08_02_preview.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: + azure.mgmt.containerservice.v2022_08_02_preview.operations.AgentPoolsOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2022_08_02_preview.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.v2022_08_02_preview.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2022_08_02_preview.operations.ResolvePrivateLinkServiceIdOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: + azure.mgmt.containerservice.v2022_08_02_preview.operations.SnapshotsOperations + :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations + :vartype managed_cluster_snapshots: + azure.mgmt.containerservice.v2022_08_02_preview.operations.ManagedClusterSnapshotsOperations + :ivar trusted_access_roles: TrustedAccessRolesOperations operations + :vartype trusted_access_roles: + azure.mgmt.containerservice.v2022_08_02_preview.operations.TrustedAccessRolesOperations + :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations + :vartype trusted_access_role_bindings: + azure.mgmt.containerservice.v2022_08_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. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2022-08-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 + ) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **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) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) + self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.trusted_access_roles = TrustedAccessRolesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> 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, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ContainerServiceClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_metadata.json new file mode 100644 index 000000000000..a4a110155c34 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_metadata.json @@ -0,0 +1,112 @@ +{ + "chosen_version": "2022-08-02-preview", + "total_api_version_list": ["2022-08-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_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"ContainerServiceClientConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"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 + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription. Required.", + "docstring_type": "str", + "required": true + } + }, + "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. Required.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "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 + }, + "base_url": { + "signature": "base_url: str = \"https://management.azure.com\",", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "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\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "operations": "Operations", + "managed_clusters": "ManagedClustersOperations", + "maintenance_configurations": "MaintenanceConfigurationsOperations", + "agent_pools": "AgentPoolsOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "resolve_private_link_service_id": "ResolvePrivateLinkServiceIdOperations", + "snapshots": "SnapshotsOperations", + "managed_cluster_snapshots": "ManagedClusterSnapshotsOperations", + "trusted_access_roles": "TrustedAccessRolesOperations", + "trusted_access_role_bindings": "TrustedAccessRoleBindingsOperations" + } +} \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_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/v2022_08_02_preview/_vendor.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_vendor.py new file mode 100644 index 000000000000..9aad73fc743e --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# 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 + + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] + template = "/".join(components) 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 new file mode 100644 index 000000000000..e5754a47ce68 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_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/v2022_08_02_preview/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/__init__.py new file mode 100644 index 000000000000..a8716d29afe8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# 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 * # type: ignore # 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/v2022_08_02_preview/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/_configuration.py new file mode 100644 index 000000000000..dc6342ccd5a8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/_configuration.py @@ -0,0 +1,66 @@ +# 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.configuration import Configuration +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(Configuration): # pylint: disable=too-many-instance-attributes + """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. Required. + :type subscription_id: str + :keyword api_version: Api Version. Default value is "2022-08-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: + super(ContainerServiceClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop("api_version", "2022-08-02-preview") # type: str + + 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._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.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**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.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/v2022_08_02_preview/aio/_container_service_client.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/_container_service_client.py new file mode 100644 index 000000000000..7dd7a7021b6f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/_container_service_client.py @@ -0,0 +1,159 @@ +# 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.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient + +from .. import models +from ..._serialization import Deserializer, Serializer +from ._configuration import ContainerServiceClientConfiguration +from .operations import ( + AgentPoolsOperations, + MaintenanceConfigurationsOperations, + ManagedClusterSnapshotsOperations, + ManagedClustersOperations, + 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.v2022_08_02_preview.aio.operations.Operations + :ivar managed_clusters: ManagedClustersOperations operations + :vartype managed_clusters: + azure.mgmt.containerservice.v2022_08_02_preview.aio.operations.ManagedClustersOperations + :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations + :vartype maintenance_configurations: + azure.mgmt.containerservice.v2022_08_02_preview.aio.operations.MaintenanceConfigurationsOperations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: + azure.mgmt.containerservice.v2022_08_02_preview.aio.operations.AgentPoolsOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: + azure.mgmt.containerservice.v2022_08_02_preview.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.v2022_08_02_preview.aio.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.v2022_08_02_preview.aio.operations.ResolvePrivateLinkServiceIdOperations + :ivar snapshots: SnapshotsOperations operations + :vartype snapshots: + azure.mgmt.containerservice.v2022_08_02_preview.aio.operations.SnapshotsOperations + :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations + :vartype managed_cluster_snapshots: + azure.mgmt.containerservice.v2022_08_02_preview.aio.operations.ManagedClusterSnapshotsOperations + :ivar trusted_access_roles: TrustedAccessRolesOperations operations + :vartype trusted_access_roles: + azure.mgmt.containerservice.v2022_08_02_preview.aio.operations.TrustedAccessRolesOperations + :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations + :vartype trusted_access_role_bindings: + azure.mgmt.containerservice.v2022_08_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. Required. + :type subscription_id: str + :param base_url: Service URL. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: Api Version. Default value is "2022-08-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 + ) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **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) + self.managed_clusters = ManagedClustersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.maintenance_configurations = MaintenanceConfigurationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) + self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.trusted_access_roles = TrustedAccessRolesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> 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, **kwargs) + + 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) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_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/v2022_08_02_preview/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/__init__.py new file mode 100644 index 000000000000..6a931af99fa3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/__init__.py @@ -0,0 +1,39 @@ +# 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 ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +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 * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "ManagedClustersOperations", + "MaintenanceConfigurationsOperations", + "AgentPoolsOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "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/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 new file mode 100644 index 000000000000..d8bd33046a8a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_agent_pools_operations.py @@ -0,0 +1,917 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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_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, +) + +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.v2022_08_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") + + @distributed_trace_async + async def abort_latest_operation( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> None: + """Aborts last operation running on agent pool. + + Aborting last running operation on agent pool. We return a 204 no content code here to indicate + that the operation has been accepted and an abort will be attempted but is not guaranteed to + complete successfully. Please look up the provisioning state of the agent pool to keep track of + whether it changes to Canceled. A canceled provisioning state indicates that the abort was + successful. + + :param resource_group_name: The name of the resource group. The name is 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.abort_latest_operation.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [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, {}) + + abort_latest_operation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AgentPool or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPool or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] + + 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, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # 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], + **kwargs: Any + ) -> _models.AgentPool: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self._create_or_update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + return deserialized + + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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], + **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 model type or a IO type. + Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( # type: ignore + 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, {}) + return deserialized + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # 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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPoolUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolUpgradeProfile] + + 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, + template_url=self.get_upgrade_profile.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get_upgrade_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolAvailableVersions or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPoolAvailableVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolAvailableVersions] + + 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, + template_url=self.get_available_agent_pool_versions.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get_available_agent_pool_versions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions"} # 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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AgentPool]] + + 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, + template_url=self._upgrade_node_image_version_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + return deserialized + + _upgrade_node_image_version_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # 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[None]: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either AgentPool or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._upgrade_node_image_version_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): + 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) + return deserialized + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_upgrade_node_image_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # type: ignore 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 new file mode 100644 index 000000000000..9fc288196b08 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_maintenance_configurations_operations.py @@ -0,0 +1,429 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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, +) + +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.v2022_08_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") + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MaintenanceConfiguration or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_managed_cluster.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list_by_managed_cluster.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfiguration] + + 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, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], + **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 model type or + a IO type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.delete.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore 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 new file mode 100644 index 000000000000..506398827c7f --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_cluster_snapshots_operations.py @@ -0,0 +1,633 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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, +) + +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.v2022_08_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") + + @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. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] + + request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], + **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 model type or + a IO type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], **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 model type or a IO type. Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.update_tags.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.delete.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore 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 new file mode 100644 index 000000000000..023aa101a330 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_managed_clusters_operations.py @@ -0,0 +1,2586 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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_os_options_request, + build_get_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_outbound_network_dependencies_endpoints_request, + build_list_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, +) + +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.v2022_08_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") + + @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 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OSOptionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.OSOptionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OSOptionProfile] + + request = build_get_os_options_request( + location=location, + subscription_id=self._config.subscription_id, + resource_type=resource_type, + api_version=api_version, + template_url=self.get_os_options.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get_os_options.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default"} # 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. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedCluster or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedCluster or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterUpgradeProfile] + + 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, + template_url=self.get_upgrade_profile.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get_upgrade_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterAccessProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAccessProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterAccessProfile] + + 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, + template_url=self.get_access_profile.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get_access_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] + + 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, + template_url=self.list_cluster_admin_credentials.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + list_cluster_admin_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential"} # 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.v2022_08_02_preview.models.Format + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] + + 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, + template_url=self.list_cluster_user_credentials.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + list_cluster_user_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] + + 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, + template_url=self.list_cluster_monitoring_user_credentials.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + list_cluster_monitoring_user_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedCluster or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + + request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore + + async def _create_or_update_initial( + self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any + ) -> _models.ManagedCluster: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self._create_or_update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + return deserialized + + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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], **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 model type or a IO + type. Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_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): + deserialized = self._deserialize("ManagedCluster", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore + + async def _update_tags_initial( + self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any + ) -> _models.ManagedCluster: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self._update_tags_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + _update_tags_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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], **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 model type or a IO type. Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_tags_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): + deserialized = self._deserialize("ManagedCluster", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # 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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # 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], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self._reset_service_principal_profile_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _reset_service_principal_profile_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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], + **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 + model type or a IO type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterServicePrincipalProfile + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_reset_service_principal_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # 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], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self._reset_aad_profile_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _reset_aad_profile_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # 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. + + Reset the AAD 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 + :param parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + Reset the AAD 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 + :param parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + Reset the AAD 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 + :param parameters: The AAD profile to set on the Managed Cluster. Is either a model type or a + IO type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAADProfile or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_reset_aad_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # type: ignore + + @distributed_trace_async + async def abort_latest_operation( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Aborts last operation running on managed cluster. + + Aborting last running operation on managed cluster. We return a 204 no content code here to + indicate that the operation has been accepted and an abort will be attempted but is not + guaranteed to complete successfully. Please look up the provisioning state of the managed + cluster to keep track of whether it changes to Canceled. A canceled provisioning state + indicates that the abort was successful. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.abort_latest_operation.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [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, {}) + + abort_latest_operation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort"} # 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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._rotate_cluster_certificates_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _rotate_cluster_certificates_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_rotate_cluster_certificates.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # type: ignore + + async def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._rotate_service_account_signing_keys_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _rotate_service_account_signing_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore + + @distributed_trace_async + async def begin_rotate_service_account_signing_keys( + 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_rotate_service_account_signing_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore + + async def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._stop_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # type: ignore + + async def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._start_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO], + **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_payload, (IO, 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, + template_url=self._run_command_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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 + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _run_command_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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], + **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 model type or a IO type. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.RunCommandRequest or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.v2022_08_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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = await self._run_command_initial( # type: ignore + 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, {}) + return deserialized + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_run_command.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunCommandResult or None or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.RunCommandResult or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] + + 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, + template_url=self.get_command_result.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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 + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_command_result.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}"} # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( + 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpoint or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.OutboundEnvironmentEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_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, + template_url=self.list_outbound_network_dependencies_endpoints.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints"} # type: ignore 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 new file mode 100644 index 000000000000..80712f578d53 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_operations.py @@ -0,0 +1,127 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse + +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 + +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.v2022_08_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") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.OperationValue"]: + """Gets a list of operations. + + Gets a list of operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationValue or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.OperationValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/providers/Microsoft.ContainerService/operations"} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_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/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 new file mode 100644 index 000000000000..a8f9e8611a21 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,461 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Optional, 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, +) + +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.v2022_08_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") + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnectionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + + request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] + + 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, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], + **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 model type or a IO + type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnection or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # 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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, AsyncPollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) # type: AsyncPollingMethod + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore 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 new file mode 100644 index 000000000000..d333ba373ede --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,115 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, 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 + +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.v2022_08_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") + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResourcesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourcesListResult] + + request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources"} # type: ignore 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 new file mode 100644 index 000000000000..fa8bb18c4764 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,197 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Optional, 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 + +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.v2022_08_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") + + @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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], + **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 model type or a IO type. Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResource + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResource] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.post.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + post.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId"} # type: ignore 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 new file mode 100644 index 000000000000..eb555c4f5ca5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_snapshots_operations.py @@ -0,0 +1,621 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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, +) + +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.v2022_08_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") + + @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. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Snapshot or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Snapshot or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] + + request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], **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 model type or a IO type. + Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], **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 model + type or a IO type. Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.update_tags.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.delete.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore 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 new file mode 100644 index 000000000000..d0310d3ac1b4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_role_bindings_operations.py @@ -0,0 +1,429 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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._trusted_access_role_bindings_operations import ( + build_create_or_update_request, + build_delete_request, + build_get_request, + build_list_request, +) + +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.v2022_08_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") + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrustedAccessRoleBinding or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBinding] + + 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, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore + + @overload + async def 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 + ) -> _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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrustedAccessRoleBinding or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrustedAccessRoleBinding or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def 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], + **kwargs: Any + ) -> _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 model type or a + IO type. Required. + :type trusted_access_role_binding: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrustedAccessRoleBinding or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBinding] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(trusted_access_role_binding, (IO, 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, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore + + @distributed_trace_async + async def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.delete.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore 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 new file mode 100644 index 000000000000..552d365404ee --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/aio/operations/_trusted_access_roles_operations.py @@ -0,0 +1,131 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse + +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 + +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.v2022_08_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") + + @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 Azure region. Required. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TrustedAccessRole or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRole] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles"} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/__init__.py new file mode 100644 index 000000000000..df6d509b5b56 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/__init__.py @@ -0,0 +1,345 @@ +# 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 AgentPool +from ._models_py3 import AgentPoolAvailableVersions +from ._models_py3 import AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem +from ._models_py3 import AgentPoolListResult +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 ContainerServiceDiagnosticsProfile +from ._models_py3 import ContainerServiceLinuxProfile +from ._models_py3 import ContainerServiceMasterProfile +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 ContainerServiceVMDiagnostics +from ._models_py3 import CreationData +from ._models_py3 import CredentialResult +from ._models_py3 import CredentialResults +from ._models_py3 import EndpointDependency +from ._models_py3 import EndpointDetail +from ._models_py3 import ExtendedLocation +from ._models_py3 import GuardrailsProfile +from ._models_py3 import KubeletConfig +from ._models_py3 import LinuxOSConfig +from ._models_py3 import MaintenanceConfiguration +from ._models_py3 import MaintenanceConfigurationListResult +from ._models_py3 import ManagedCluster +from ._models_py3 import ManagedClusterAADProfile +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 ManagedClusterAzureMonitorProfileKubeStateMetrics +from ._models_py3 import ManagedClusterAzureMonitorProfileMetrics +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 ManagedClusterNATGatewayProfile +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 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 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 NetworkProfileForSnapshot +from ._models_py3 import OSOptionProfile +from ._models_py3 import OSOptionProperty +from ._models_py3 import OperationListResult +from ._models_py3 import OperationValue +from ._models_py3 import OutboundEnvironmentEndpoint +from ._models_py3 import OutboundEnvironmentEndpointCollection +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 Resource +from ._models_py3 import ResourceReference +from ._models_py3 import RunCommandRequest +from ._models_py3 import RunCommandResult +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 UserAssignedIdentity +from ._models_py3 import WindowsGmsaProfile + +from ._container_service_client_enums import AgentPoolMode +from ._container_service_client_enums import AgentPoolType +from ._container_service_client_enums import BackendPoolType +from ._container_service_client_enums import Code +from ._container_service_client_enums import ConnectionStatus +from ._container_service_client_enums import ContainerServiceStorageProfileTypes +from ._container_service_client_enums import ContainerServiceVMSizeTypes +from ._container_service_client_enums import ControlledValues +from ._container_service_client_enums import Count +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 IpFamily +from ._container_service_client_enums import IpvsScheduler +from ._container_service_client_enums import KeyVaultNetworkAccessTypes +from ._container_service_client_enums import KubeletDiskType +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 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 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 PrivateEndpointConnectionProvisioningState +from ._container_service_client_enums import PublicNetworkAccess +from ._container_service_client_enums import ResourceIdentityType +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 SnapshotType +from ._container_service_client_enums import TrustedAccessRoleBindingProvisioningState +from ._container_service_client_enums import UpdateMode +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 * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AgentPool", + "AgentPoolAvailableVersions", + "AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem", + "AgentPoolListResult", + "AgentPoolUpgradeProfile", + "AgentPoolUpgradeProfilePropertiesUpgradesItem", + "AgentPoolUpgradeSettings", + "AgentPoolWindowsProfile", + "AzureKeyVaultKms", + "CloudErrorBody", + "ContainerServiceDiagnosticsProfile", + "ContainerServiceLinuxProfile", + "ContainerServiceMasterProfile", + "ContainerServiceNetworkProfile", + "ContainerServiceNetworkProfileKubeProxyConfig", + "ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig", + "ContainerServiceSshConfiguration", + "ContainerServiceSshPublicKey", + "ContainerServiceVMDiagnostics", + "CreationData", + "CredentialResult", + "CredentialResults", + "EndpointDependency", + "EndpointDetail", + "ExtendedLocation", + "GuardrailsProfile", + "KubeletConfig", + "LinuxOSConfig", + "MaintenanceConfiguration", + "MaintenanceConfigurationListResult", + "ManagedCluster", + "ManagedClusterAADProfile", + "ManagedClusterAPIServerAccessProfile", + "ManagedClusterAccessProfile", + "ManagedClusterAddonProfile", + "ManagedClusterAddonProfileIdentity", + "ManagedClusterAgentPoolProfile", + "ManagedClusterAgentPoolProfileProperties", + "ManagedClusterAutoUpgradeProfile", + "ManagedClusterAzureMonitorProfile", + "ManagedClusterAzureMonitorProfileKubeStateMetrics", + "ManagedClusterAzureMonitorProfileMetrics", + "ManagedClusterHTTPProxyConfig", + "ManagedClusterIdentity", + "ManagedClusterIngressProfile", + "ManagedClusterIngressProfileWebAppRouting", + "ManagedClusterListResult", + "ManagedClusterLoadBalancerProfile", + "ManagedClusterLoadBalancerProfileManagedOutboundIPs", + "ManagedClusterLoadBalancerProfileOutboundIPPrefixes", + "ManagedClusterLoadBalancerProfileOutboundIPs", + "ManagedClusterManagedOutboundIPProfile", + "ManagedClusterNATGatewayProfile", + "ManagedClusterOIDCIssuerProfile", + "ManagedClusterPodIdentity", + "ManagedClusterPodIdentityException", + "ManagedClusterPodIdentityProfile", + "ManagedClusterPodIdentityProvisioningError", + "ManagedClusterPodIdentityProvisioningErrorBody", + "ManagedClusterPodIdentityProvisioningInfo", + "ManagedClusterPoolUpgradeProfile", + "ManagedClusterPoolUpgradeProfileUpgradesItem", + "ManagedClusterPropertiesAutoScalerProfile", + "ManagedClusterPropertiesForSnapshot", + "ManagedClusterSKU", + "ManagedClusterSecurityProfile", + "ManagedClusterSecurityProfileDefender", + "ManagedClusterSecurityProfileDefenderSecurityMonitoring", + "ManagedClusterSecurityProfileImageCleaner", + "ManagedClusterSecurityProfileNodeRestriction", + "ManagedClusterSecurityProfileWorkloadIdentity", + "ManagedClusterServicePrincipalProfile", + "ManagedClusterSnapshot", + "ManagedClusterSnapshotListResult", + "ManagedClusterStorageProfile", + "ManagedClusterStorageProfileBlobCSIDriver", + "ManagedClusterStorageProfileDiskCSIDriver", + "ManagedClusterStorageProfileFileCSIDriver", + "ManagedClusterStorageProfileSnapshotController", + "ManagedClusterUpgradeProfile", + "ManagedClusterWindowsProfile", + "ManagedClusterWorkloadAutoScalerProfile", + "ManagedClusterWorkloadAutoScalerProfileKeda", + "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", + "ManagedServiceIdentityUserAssignedIdentitiesValue", + "NetworkProfileForSnapshot", + "OSOptionProfile", + "OSOptionProperty", + "OperationListResult", + "OperationValue", + "OutboundEnvironmentEndpoint", + "OutboundEnvironmentEndpointCollection", + "PowerState", + "PrivateEndpoint", + "PrivateEndpointConnection", + "PrivateEndpointConnectionListResult", + "PrivateLinkResource", + "PrivateLinkResourcesListResult", + "PrivateLinkServiceConnectionState", + "Resource", + "ResourceReference", + "RunCommandRequest", + "RunCommandResult", + "Snapshot", + "SnapshotListResult", + "SubResource", + "SysctlConfig", + "SystemData", + "TagsObject", + "TimeInWeek", + "TimeSpan", + "TrackedResource", + "TrustedAccessRole", + "TrustedAccessRoleBinding", + "TrustedAccessRoleBindingListResult", + "TrustedAccessRoleListResult", + "TrustedAccessRoleRule", + "UserAssignedIdentity", + "WindowsGmsaProfile", + "AgentPoolMode", + "AgentPoolType", + "BackendPoolType", + "Code", + "ConnectionStatus", + "ContainerServiceStorageProfileTypes", + "ContainerServiceVMSizeTypes", + "ControlledValues", + "Count", + "CreatedByType", + "Expander", + "ExtendedLocationTypes", + "Format", + "GPUInstanceProfile", + "IpFamily", + "IpvsScheduler", + "KeyVaultNetworkAccessTypes", + "KubeletDiskType", + "Level", + "LicenseType", + "LoadBalancerSku", + "ManagedClusterPodIdentityProvisioningState", + "ManagedClusterSKUName", + "ManagedClusterSKUTier", + "Mode", + "NetworkMode", + "NetworkPlugin", + "NetworkPluginMode", + "NetworkPolicy", + "OSDiskType", + "OSSKU", + "OSType", + "OutboundType", + "PrivateEndpointConnectionProvisioningState", + "PublicNetworkAccess", + "ResourceIdentityType", + "ScaleDownMode", + "ScaleSetEvictionPolicy", + "ScaleSetPriority", + "SnapshotType", + "TrustedAccessRoleBindingProvisioningState", + "UpdateMode", + "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/v2022_08_02_preview/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_container_service_client_enums.py new file mode 100644 index 000000000000..657b61d1424d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_container_service_client_enums.py @@ -0,0 +1,709 @@ +# 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 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 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. + SYSTEM = "System" + #: User agent pools are primarily for hosting your application pods. + USER = "User" + + +class AgentPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of Agent Pool.""" + + #: Create an Agent Pool backed by a Virtual Machine Scale Set. + VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" + #: Use of this is strongly discouraged. + AVAILABILITY_SET = "AvailabilitySet" + + +class BackendPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of the managed inbound Load Balancer BackendPool.""" + + #: The type of the managed inbound Load Balancer BackendPool. + #: https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend. + 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" + + +class Code(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Tells whether the cluster is Running or Stopped.""" + + #: The cluster is running. + RUNNING = "Running" + #: The cluster is stopped. + STOPPED = "Stopped" + + +class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The private link service connection status.""" + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + DISCONNECTED = "Disconnected" + + +class ContainerServiceStorageProfileTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies what kind of storage to use. If omitted, the default will be chosen on your behalf + based on the choice of orchestrator. + """ + + STORAGE_ACCOUNT = "StorageAccount" + MANAGED_DISKS = "ManagedDisks" + + +class ContainerServiceVMSizeTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Size of agent VMs. Note: This is no longer maintained.""" + + STANDARD_A1 = "Standard_A1" + STANDARD_A10 = "Standard_A10" + STANDARD_A11 = "Standard_A11" + STANDARD_A1_V2 = "Standard_A1_v2" + STANDARD_A2 = "Standard_A2" + STANDARD_A2_V2 = "Standard_A2_v2" + STANDARD_A2_M_V2 = "Standard_A2m_v2" + STANDARD_A3 = "Standard_A3" + STANDARD_A4 = "Standard_A4" + STANDARD_A4_V2 = "Standard_A4_v2" + STANDARD_A4_M_V2 = "Standard_A4m_v2" + STANDARD_A5 = "Standard_A5" + STANDARD_A6 = "Standard_A6" + STANDARD_A7 = "Standard_A7" + STANDARD_A8 = "Standard_A8" + STANDARD_A8_V2 = "Standard_A8_v2" + STANDARD_A8_M_V2 = "Standard_A8m_v2" + STANDARD_A9 = "Standard_A9" + STANDARD_B2_MS = "Standard_B2ms" + STANDARD_B2_S = "Standard_B2s" + STANDARD_B4_MS = "Standard_B4ms" + STANDARD_B8_MS = "Standard_B8ms" + STANDARD_D1 = "Standard_D1" + STANDARD_D11 = "Standard_D11" + STANDARD_D11_V2 = "Standard_D11_v2" + STANDARD_D11_V2_PROMO = "Standard_D11_v2_Promo" + STANDARD_D12 = "Standard_D12" + STANDARD_D12_V2 = "Standard_D12_v2" + STANDARD_D12_V2_PROMO = "Standard_D12_v2_Promo" + STANDARD_D13 = "Standard_D13" + STANDARD_D13_V2 = "Standard_D13_v2" + STANDARD_D13_V2_PROMO = "Standard_D13_v2_Promo" + STANDARD_D14 = "Standard_D14" + STANDARD_D14_V2 = "Standard_D14_v2" + STANDARD_D14_V2_PROMO = "Standard_D14_v2_Promo" + STANDARD_D15_V2 = "Standard_D15_v2" + STANDARD_D16_V3 = "Standard_D16_v3" + STANDARD_D16_S_V3 = "Standard_D16s_v3" + STANDARD_D1_V2 = "Standard_D1_v2" + STANDARD_D2 = "Standard_D2" + STANDARD_D2_V2 = "Standard_D2_v2" + STANDARD_D2_V2_PROMO = "Standard_D2_v2_Promo" + STANDARD_D2_V3 = "Standard_D2_v3" + STANDARD_D2_S_V3 = "Standard_D2s_v3" + STANDARD_D3 = "Standard_D3" + STANDARD_D32_V3 = "Standard_D32_v3" + STANDARD_D32_S_V3 = "Standard_D32s_v3" + STANDARD_D3_V2 = "Standard_D3_v2" + STANDARD_D3_V2_PROMO = "Standard_D3_v2_Promo" + STANDARD_D4 = "Standard_D4" + STANDARD_D4_V2 = "Standard_D4_v2" + STANDARD_D4_V2_PROMO = "Standard_D4_v2_Promo" + STANDARD_D4_V3 = "Standard_D4_v3" + STANDARD_D4_S_V3 = "Standard_D4s_v3" + STANDARD_D5_V2 = "Standard_D5_v2" + STANDARD_D5_V2_PROMO = "Standard_D5_v2_Promo" + STANDARD_D64_V3 = "Standard_D64_v3" + STANDARD_D64_S_V3 = "Standard_D64s_v3" + STANDARD_D8_V3 = "Standard_D8_v3" + STANDARD_D8_S_V3 = "Standard_D8s_v3" + STANDARD_DS1 = "Standard_DS1" + STANDARD_DS11 = "Standard_DS11" + STANDARD_DS11_V2 = "Standard_DS11_v2" + STANDARD_DS11_V2_PROMO = "Standard_DS11_v2_Promo" + STANDARD_DS12 = "Standard_DS12" + STANDARD_DS12_V2 = "Standard_DS12_v2" + STANDARD_DS12_V2_PROMO = "Standard_DS12_v2_Promo" + STANDARD_DS13 = "Standard_DS13" + STANDARD_DS13_2_V2 = "Standard_DS13-2_v2" + STANDARD_DS13_4_V2 = "Standard_DS13-4_v2" + STANDARD_DS13_V2 = "Standard_DS13_v2" + STANDARD_DS13_V2_PROMO = "Standard_DS13_v2_Promo" + STANDARD_DS14 = "Standard_DS14" + STANDARD_DS14_4_V2 = "Standard_DS14-4_v2" + STANDARD_DS14_8_V2 = "Standard_DS14-8_v2" + STANDARD_DS14_V2 = "Standard_DS14_v2" + STANDARD_DS14_V2_PROMO = "Standard_DS14_v2_Promo" + STANDARD_DS15_V2 = "Standard_DS15_v2" + STANDARD_DS1_V2 = "Standard_DS1_v2" + STANDARD_DS2 = "Standard_DS2" + STANDARD_DS2_V2 = "Standard_DS2_v2" + STANDARD_DS2_V2_PROMO = "Standard_DS2_v2_Promo" + STANDARD_DS3 = "Standard_DS3" + STANDARD_DS3_V2 = "Standard_DS3_v2" + STANDARD_DS3_V2_PROMO = "Standard_DS3_v2_Promo" + STANDARD_DS4 = "Standard_DS4" + STANDARD_DS4_V2 = "Standard_DS4_v2" + STANDARD_DS4_V2_PROMO = "Standard_DS4_v2_Promo" + STANDARD_DS5_V2 = "Standard_DS5_v2" + STANDARD_DS5_V2_PROMO = "Standard_DS5_v2_Promo" + STANDARD_E16_V3 = "Standard_E16_v3" + STANDARD_E16_S_V3 = "Standard_E16s_v3" + STANDARD_E2_V3 = "Standard_E2_v3" + STANDARD_E2_S_V3 = "Standard_E2s_v3" + STANDARD_E32_16_S_V3 = "Standard_E32-16s_v3" + STANDARD_E32_8_S_V3 = "Standard_E32-8s_v3" + STANDARD_E32_V3 = "Standard_E32_v3" + STANDARD_E32_S_V3 = "Standard_E32s_v3" + STANDARD_E4_V3 = "Standard_E4_v3" + STANDARD_E4_S_V3 = "Standard_E4s_v3" + STANDARD_E64_16_S_V3 = "Standard_E64-16s_v3" + STANDARD_E64_32_S_V3 = "Standard_E64-32s_v3" + STANDARD_E64_V3 = "Standard_E64_v3" + STANDARD_E64_S_V3 = "Standard_E64s_v3" + STANDARD_E8_V3 = "Standard_E8_v3" + STANDARD_E8_S_V3 = "Standard_E8s_v3" + STANDARD_F1 = "Standard_F1" + STANDARD_F16 = "Standard_F16" + STANDARD_F16_S = "Standard_F16s" + STANDARD_F16_S_V2 = "Standard_F16s_v2" + STANDARD_F1_S = "Standard_F1s" + STANDARD_F2 = "Standard_F2" + STANDARD_F2_S = "Standard_F2s" + STANDARD_F2_S_V2 = "Standard_F2s_v2" + STANDARD_F32_S_V2 = "Standard_F32s_v2" + STANDARD_F4 = "Standard_F4" + STANDARD_F4_S = "Standard_F4s" + STANDARD_F4_S_V2 = "Standard_F4s_v2" + STANDARD_F64_S_V2 = "Standard_F64s_v2" + STANDARD_F72_S_V2 = "Standard_F72s_v2" + STANDARD_F8 = "Standard_F8" + STANDARD_F8_S = "Standard_F8s" + STANDARD_F8_S_V2 = "Standard_F8s_v2" + STANDARD_G1 = "Standard_G1" + STANDARD_G2 = "Standard_G2" + STANDARD_G3 = "Standard_G3" + STANDARD_G4 = "Standard_G4" + STANDARD_G5 = "Standard_G5" + STANDARD_GS1 = "Standard_GS1" + STANDARD_GS2 = "Standard_GS2" + STANDARD_GS3 = "Standard_GS3" + STANDARD_GS4 = "Standard_GS4" + STANDARD_GS4_4 = "Standard_GS4-4" + STANDARD_GS4_8 = "Standard_GS4-8" + STANDARD_GS5 = "Standard_GS5" + STANDARD_GS5_16 = "Standard_GS5-16" + STANDARD_GS5_8 = "Standard_GS5-8" + STANDARD_H16 = "Standard_H16" + STANDARD_H16_M = "Standard_H16m" + STANDARD_H16_MR = "Standard_H16mr" + STANDARD_H16_R = "Standard_H16r" + STANDARD_H8 = "Standard_H8" + STANDARD_H8_M = "Standard_H8m" + STANDARD_L16_S = "Standard_L16s" + STANDARD_L32_S = "Standard_L32s" + STANDARD_L4_S = "Standard_L4s" + STANDARD_L8_S = "Standard_L8s" + STANDARD_M128_32_MS = "Standard_M128-32ms" + STANDARD_M128_64_MS = "Standard_M128-64ms" + STANDARD_M128_MS = "Standard_M128ms" + STANDARD_M128_S = "Standard_M128s" + STANDARD_M64_16_MS = "Standard_M64-16ms" + STANDARD_M64_32_MS = "Standard_M64-32ms" + STANDARD_M64_MS = "Standard_M64ms" + STANDARD_M64_S = "Standard_M64s" + STANDARD_NC12 = "Standard_NC12" + STANDARD_NC12_S_V2 = "Standard_NC12s_v2" + STANDARD_NC12_S_V3 = "Standard_NC12s_v3" + STANDARD_NC24 = "Standard_NC24" + STANDARD_NC24_R = "Standard_NC24r" + STANDARD_NC24_RS_V2 = "Standard_NC24rs_v2" + STANDARD_NC24_RS_V3 = "Standard_NC24rs_v3" + STANDARD_NC24_S_V2 = "Standard_NC24s_v2" + STANDARD_NC24_S_V3 = "Standard_NC24s_v3" + STANDARD_NC6 = "Standard_NC6" + STANDARD_NC6_S_V2 = "Standard_NC6s_v2" + STANDARD_NC6_S_V3 = "Standard_NC6s_v3" + STANDARD_ND12_S = "Standard_ND12s" + STANDARD_ND24_RS = "Standard_ND24rs" + STANDARD_ND24_S = "Standard_ND24s" + STANDARD_ND6_S = "Standard_ND6s" + STANDARD_NV12 = "Standard_NV12" + STANDARD_NV24 = "Standard_NV24" + STANDARD_NV6 = "Standard_NV6" + + +class ControlledValues(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Controls which resource value autoscaler will change. Default value is RequestsAndLimits.""" + + #: Autoscaler will control resource requests and limits. + REQUESTS_AND_LIMITS = "RequestsAndLimits" + #: Autoscaler will control resource requests only. + REQUESTS_ONLY = "RequestsOnly" + + +class Count(int, Enum, metaclass=CaseInsensitiveEnumMeta): + """Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The + default value is 1. + """ + + ONE = 1 + THREE = 3 + FIVE = 5 + + +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. + """ + + #: 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. + LEAST_WASTE = "least-waste" + #: 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. + MOST_PODS = "most-pods" + #: Selects the node group that has the highest priority assigned by the user. It's configuration + #: is described in more details `here + #: `_. + PRIORITY = "priority" + #: Used when you don't have a particular need for the node groups to scale differently. + RANDOM = "random" + + +class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of extendedLocation.""" + + EDGE_ZONE = "EdgeZone" + + +class Format(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Format.""" + + #: Return azure auth-provider kubeconfig. This format is deprecated in 1.22 and will be fully + #: removed in 1.25. + AZURE = "azure" + #: Return exec format kubeconfig. This format requires kubelogin binary in the path. + EXEC = "exec" + + +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 IpFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The IP version to use for cluster networking and IP assignment.""" + + I_PV4 = "IPv4" + I_PV6 = "IPv6" + + +class IpvsScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """IPVS scheduler, for more information please see + http://www.linuxvirtualserver.org/docs/scheduling.html. + """ + + #: Round Robin + ROUND_ROBIN = "RoundRobin" + #: Least Connection + LEAST_CONNECTION = "LeastConnection" + + +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. + """ + + #: Kubelet will use the OS disk for its data. + OS = "OS" + #: Kubelet will use the temporary disk for its data. + TEMPORARY = "Temporary" + + +class Level(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The guardrails level to be used. By default, Guardrails 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. + """ + + #: No additional licensing is applied. + NONE = "None" + #: Enables Azure Hybrid User Benefits for Windows VMs. + WINDOWS_SERVER = "Windows_Server" + + +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. + """ + + #: 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. + STANDARD = "standard" + #: Use a basic Load Balancer with limited functionality. + BASIC = "basic" + + +class ManagedClusterPodIdentityProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state of the pod identity.""" + + ASSIGNED = "Assigned" + UPDATING = "Updating" + DELETING = "Deleting" + FAILED = "Failed" + + +class ManagedClusterSKUName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The name of a managed cluster SKU.""" + + BASIC = "Basic" + + +class ManagedClusterSKUTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. + """ + + #: 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. + PAID = "Paid" + #: No guaranteed SLA, no additional charges. Free tier clusters have an SLO of 99.5%. + FREE = "Free" + + +class Mode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specify which proxy mode to use ('IPTABLES' or 'IPVS').""" + + #: IPTables proxy mode + IPTABLES = "IPTABLES" + #: IPVS proxy mode. Must be using Kubernetes version >= 1.22. + IPVS = "IPVS" + + +class NetworkMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """This cannot be specified if networkPlugin is anything other than 'azure'.""" + + #: No bridge is created. Intra-VM Pod to Pod communication is through IP routes created by Azure + #: CNI. See `Transparent Mode `_ for + #: more information. + TRANSPARENT = "transparent" + #: This is no longer supported + BRIDGE = "bridge" + + +class NetworkPlugin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network plugin used for building the Kubernetes network.""" + + #: Use the Azure CNI network plugin. See `Azure CNI (advanced) networking + #: `_ for + #: more information. + AZURE = "azure" + #: Use the Kubenet network plugin. See `Kubenet (basic) networking + #: `_ for more + #: information. + KUBENET = "kubenet" + #: Do not use a network plugin. A custom CNI will need to be installed after cluster creation for + #: networking functionality. + NONE = "none" + + +class NetworkPluginMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The mode the network plugin should use.""" + + #: Pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than + #: Kubenet reference plugins host-local and bridge. + OVERLAY = "Overlay" + + +class NetworkPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Network policy used for building the Kubernetes network.""" + + #: Use Calico network policies. See `differences between Azure and Calico policies + #: `_ + #: for more information. + CALICO = "calico" + #: Use Azure network policies. See `differences between Azure and Calico policies + #: `_ + #: for more information. + AZURE = "azure" + + +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 + `_. + """ + + #: 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. + MANAGED = "Managed" + #: 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. + EPHEMERAL = "Ephemeral" + + +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" + CBL_MARINER = "CBLMariner" + MARINER = "Mariner" + WINDOWS2019 = "Windows2019" + WINDOWS2022 = "Windows2022" + + +class OSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The operating system type. The default is Linux.""" + + #: Use Linux. + LINUX = "Linux" + #: Use Windows. + WINDOWS = "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 `_. + """ + + #: 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 + #: `_. + LOAD_BALANCER = "loadBalancer" + #: 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 + #: `_. + USER_DEFINED_ROUTING = "userDefinedRouting" + #: The AKS-managed NAT gateway is used for egress. + MANAGED_NAT_GATEWAY = "managedNATGateway" + #: The user-assigned NAT gateway associated to the cluster subnet is used for egress. This is an + #: advanced scenario and requires proper network configuration. + USER_ASSIGNED_NAT_GATEWAY = "userAssignedNATGateway" + + +class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state.""" + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + + +class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Allow or deny public network access for AKS.""" + + #: Inbound/Outbound to the managedCluster is allowed. + ENABLED = "Enabled" + #: Inbound traffic to managedCluster is disabled, traffic from managedCluster is allowed. + DISABLED = "Disabled" + #: Inbound/Outbound traffic is managed by Microsoft.Network/NetworkSecurityPerimeters. + SECURED_BY_PERIMETER = "SecuredByPerimeter" + + +class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """For more information see `use managed identities in AKS + `_. + """ + + #: 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. + SYSTEM_ASSIGNED = "SystemAssigned" + #: 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. + USER_ASSIGNED = "UserAssigned" + #: Do not use a managed identity for the Managed Cluster, service principal will be used instead. + NONE = "None" + + +class ScaleDownMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Describes how VMs are added to or removed from Agent Pools. See `billing states + `_. + """ + + #: Create new instances during scale up and remove instances during scale down. + DELETE = "Delete" + #: Attempt to start deallocated instances (if they exist) during scale up and deallocate instances + #: during scale down. + DEALLOCATE = "Deallocate" + + +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 + `_. + """ + + #: Nodes in the underlying Scale Set of the node pool are deleted when they're evicted. + DELETE = "Delete" + #: 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. + DEALLOCATE = "Deallocate" + + +class ScaleSetPriority(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The Virtual Machine Scale Set priority.""" + + #: Spot priority VMs will be used. There is no SLA for spot nodes. See `spot on AKS + #: `_ for more information. + SPOT = "Spot" + #: Regular VMs will be used. + REGULAR = "Regular" + + +class SnapshotType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of a snapshot. The default is NodePool.""" + + #: The snapshot is a snapshot of a node pool. + NODE_POOL = "NodePool" + #: The snapshot is a snapshot of a managed cluster. + MANAGED_CLUSTER = "ManagedCluster" + + +class TrustedAccessRoleBindingProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state of trusted access role binding.""" + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + UPDATING = "Updating" + DELETING = "Deleting" + + +class UpdateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Each update mode level is a superset of the lower levels. Off`_. + """ + + #: 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. + RAPID = "rapid" + #: 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. + STABLE = "stable" + #: 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. + PATCH = "patch" + #: Automatically upgrade the node image to the latest version available. Microsoft provides + #: patches and new images for image nodes frequently (usually weekly), but your running nodes + #: won't get the new images unless you do a node image upgrade. Turning on the node-image channel + #: will automatically update your node images whenever a new version is available. + NODE_IMAGE = "node-image" + #: Disables auto-upgrades and keeps the cluster at its current version of Kubernetes. + NONE = "none" + + +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.""" + + #: Nodes will use Kubelet to run standard OCI container workloads. + OCI_CONTAINER = "OCIContainer" + #: Nodes will use Krustlet to run WASM workloads using the WASI provider (Preview). + WASM_WASI = "WasmWasi" 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 new file mode 100644 index 000000000000..e9a8fdc2e4b6 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_models_py3.py @@ -0,0 +1,7376 @@ +# 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 Dict, List, Optional, TYPE_CHECKING, Union + +from ... import _serialization + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models + + +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): + """ """ + 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.v2022_08_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.v2022_08_02_preview.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Known values are: + "OCIContainer" and "WasmWasi". + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2022_08_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}. + :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}. + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and + "Windows". + :vartype os_type: str or ~azure.mgmt.containerservice.v2022_08_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", + "CBLMariner", "Mariner", "Windows2019", and "Windows2022". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ScaleDownMode + :ivar type_properties_type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" + and "AvailabilitySet". + :vartype type_properties_type: str or + ~azure.mgmt.containerservice.v2022_08_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" and "User". + :vartype mode: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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 deploys a daemonset and host services to + sync custom certificate authorities from a user-provided config map 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}. + :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.v2022_08_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.v2022_08_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 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.v2022_08_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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}. + 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.v2022_08_02_preview.models.AgentPoolWindowsProfile + """ + + _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"}, + "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]"}, + "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"}, + } + + 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, + 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, + 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, + **kwargs + ): + """ + :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.v2022_08_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.v2022_08_02_preview.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Known values are: + "OCIContainer" and "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2022_08_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}. + :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}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" + and "Windows". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2022_08_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", + "CBLMariner", "Mariner", "Windows2019", and "Windows2022". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ScaleDownMode + :keyword type_properties_type: The type of Agent Pool. Known values are: + "VirtualMachineScaleSets" and "AvailabilitySet". + :paramtype type_properties_type: str or + ~azure.mgmt.containerservice.v2022_08_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" and "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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 + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword enable_custom_ca_trust: When set to true, AKS deploys a daemonset and host services to + sync custom certificate authorities from a user-provided config map 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}. + :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.v2022_08_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.v2022_08_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 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.v2022_08_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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}. + 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.v2022_08_02_preview.models.AgentPoolWindowsProfile + """ + 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.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.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 + + +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.v2022_08_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ + + _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 + ): + """ + :keyword agent_pool_versions: List of versions available for agent pool. + :paramtype agent_pool_versions: + list[~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.agent_pool_versions = agent_pool_versions + + +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(_serialization.Model): + """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 + ): + """ + :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 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.v2022_08_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): + """ + :keyword value: The list of agent pools. + :paramtype value: list[~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +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 Azure. + + :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.v2022_08_02_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.v2022_08_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 + ): + """ + :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.v2022_08_02_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2022_08_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): + """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): + """ + :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 + """ + + _attribute_map = { + "max_surge": {"key": "maxSurge", "type": "str"}, + } + + def __init__(self, *, max_surge: Optional[str] = None, **kwargs): + """ + :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 + """ + super().__init__(**kwargs) + self.max_surge = max_surge + + +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): + """ + :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 + `_ + 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.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. + :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 + ): + """ + :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 + `_ + 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.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. + :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.v2022_08_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 + ): + """ + :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.v2022_08_02_preview.models.CloudErrorBody] + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ContainerServiceDiagnosticsProfile(_serialization.Model): + """Profile for diagnostics on the container service cluster. + + All required parameters must be populated in order to send to Azure. + + :ivar vm_diagnostics: Profile for diagnostics on the container service VMs. Required. + :vartype vm_diagnostics: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ContainerServiceVMDiagnostics + """ + + _validation = { + "vm_diagnostics": {"required": True}, + } + + _attribute_map = { + "vm_diagnostics": {"key": "vmDiagnostics", "type": "ContainerServiceVMDiagnostics"}, + } + + def __init__(self, *, vm_diagnostics: "_models.ContainerServiceVMDiagnostics", **kwargs): + """ + :keyword vm_diagnostics: Profile for diagnostics on the container service VMs. Required. + :paramtype vm_diagnostics: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ContainerServiceVMDiagnostics + """ + super().__init__(**kwargs) + self.vm_diagnostics = vm_diagnostics + + +class ContainerServiceLinuxProfile(_serialization.Model): + """Profile for Linux VMs in the container service cluster. + + All required parameters must be populated in order to send to Azure. + + :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.v2022_08_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): + """ + :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.v2022_08_02_preview.models.ContainerServiceSshConfiguration + """ + super().__init__(**kwargs) + self.admin_username = admin_username + self.ssh = ssh + + +class ContainerServiceMasterProfile(_serialization.Model): + """Profile for the container service master. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar count: Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, + and 5. The default value is 1. Known values are: 1, 3, and 5. + :vartype count: int or ~azure.mgmt.containerservice.v2022_08_02_preview.models.Count + :ivar dns_prefix: DNS prefix to be used to create the FQDN for the master pool. Required. + :vartype dns_prefix: str + :ivar vm_size: Size of agent VMs. Required. Known values are: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", and "Standard_NV6". + :vartype vm_size: str or + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ContainerServiceVMSizeTypes + :ivar os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every machine + in this 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 vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :vartype vnet_subnet_id: str + :ivar first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static ip + of masters. + :vartype first_consecutive_static_ip: str + :ivar storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Known values are: "StorageAccount" and "ManagedDisks". + :vartype storage_profile: str or + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ContainerServiceStorageProfileTypes + :ivar fqdn: FQDN for the master pool. + :vartype fqdn: str + """ + + _validation = { + "dns_prefix": {"required": True}, + "vm_size": {"required": True}, + "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, + "fqdn": {"readonly": True}, + } + + _attribute_map = { + "count": {"key": "count", "type": "int"}, + "dns_prefix": {"key": "dnsPrefix", "type": "str"}, + "vm_size": {"key": "vmSize", "type": "str"}, + "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, + "vnet_subnet_id": {"key": "vnetSubnetID", "type": "str"}, + "first_consecutive_static_ip": {"key": "firstConsecutiveStaticIP", "type": "str"}, + "storage_profile": {"key": "storageProfile", "type": "str"}, + "fqdn": {"key": "fqdn", "type": "str"}, + } + + def __init__( + self, + *, + dns_prefix: str, + vm_size: Union[str, "_models.ContainerServiceVMSizeTypes"], + count: Union[int, "_models.Count"] = 1, + os_disk_size_gb: Optional[int] = None, + vnet_subnet_id: Optional[str] = None, + first_consecutive_static_ip: str = "10.240.255.5", + storage_profile: Optional[Union[str, "_models.ContainerServiceStorageProfileTypes"]] = None, + **kwargs + ): + """ + :keyword count: Number of masters (VMs) in the container service cluster. Allowed values are 1, + 3, and 5. The default value is 1. Known values are: 1, 3, and 5. + :paramtype count: int or ~azure.mgmt.containerservice.v2022_08_02_preview.models.Count + :keyword dns_prefix: DNS prefix to be used to create the FQDN for the master pool. Required. + :paramtype dns_prefix: str + :keyword vm_size: Size of agent VMs. Required. Known values are: "Standard_A1", "Standard_A10", + "Standard_A11", "Standard_A1_v2", "Standard_A2", "Standard_A2_v2", "Standard_A2m_v2", + "Standard_A3", "Standard_A4", "Standard_A4_v2", "Standard_A4m_v2", "Standard_A5", + "Standard_A6", "Standard_A7", "Standard_A8", "Standard_A8_v2", "Standard_A8m_v2", + "Standard_A9", "Standard_B2ms", "Standard_B2s", "Standard_B4ms", "Standard_B8ms", + "Standard_D1", "Standard_D11", "Standard_D11_v2", "Standard_D11_v2_Promo", "Standard_D12", + "Standard_D12_v2", "Standard_D12_v2_Promo", "Standard_D13", "Standard_D13_v2", + "Standard_D13_v2_Promo", "Standard_D14", "Standard_D14_v2", "Standard_D14_v2_Promo", + "Standard_D15_v2", "Standard_D16_v3", "Standard_D16s_v3", "Standard_D1_v2", "Standard_D2", + "Standard_D2_v2", "Standard_D2_v2_Promo", "Standard_D2_v3", "Standard_D2s_v3", "Standard_D3", + "Standard_D32_v3", "Standard_D32s_v3", "Standard_D3_v2", "Standard_D3_v2_Promo", "Standard_D4", + "Standard_D4_v2", "Standard_D4_v2_Promo", "Standard_D4_v3", "Standard_D4s_v3", + "Standard_D5_v2", "Standard_D5_v2_Promo", "Standard_D64_v3", "Standard_D64s_v3", + "Standard_D8_v3", "Standard_D8s_v3", "Standard_DS1", "Standard_DS11", "Standard_DS11_v2", + "Standard_DS11_v2_Promo", "Standard_DS12", "Standard_DS12_v2", "Standard_DS12_v2_Promo", + "Standard_DS13", "Standard_DS13-2_v2", "Standard_DS13-4_v2", "Standard_DS13_v2", + "Standard_DS13_v2_Promo", "Standard_DS14", "Standard_DS14-4_v2", "Standard_DS14-8_v2", + "Standard_DS14_v2", "Standard_DS14_v2_Promo", "Standard_DS15_v2", "Standard_DS1_v2", + "Standard_DS2", "Standard_DS2_v2", "Standard_DS2_v2_Promo", "Standard_DS3", "Standard_DS3_v2", + "Standard_DS3_v2_Promo", "Standard_DS4", "Standard_DS4_v2", "Standard_DS4_v2_Promo", + "Standard_DS5_v2", "Standard_DS5_v2_Promo", "Standard_E16_v3", "Standard_E16s_v3", + "Standard_E2_v3", "Standard_E2s_v3", "Standard_E32-16s_v3", "Standard_E32-8s_v3", + "Standard_E32_v3", "Standard_E32s_v3", "Standard_E4_v3", "Standard_E4s_v3", + "Standard_E64-16s_v3", "Standard_E64-32s_v3", "Standard_E64_v3", "Standard_E64s_v3", + "Standard_E8_v3", "Standard_E8s_v3", "Standard_F1", "Standard_F16", "Standard_F16s", + "Standard_F16s_v2", "Standard_F1s", "Standard_F2", "Standard_F2s", "Standard_F2s_v2", + "Standard_F32s_v2", "Standard_F4", "Standard_F4s", "Standard_F4s_v2", "Standard_F64s_v2", + "Standard_F72s_v2", "Standard_F8", "Standard_F8s", "Standard_F8s_v2", "Standard_G1", + "Standard_G2", "Standard_G3", "Standard_G4", "Standard_G5", "Standard_GS1", "Standard_GS2", + "Standard_GS3", "Standard_GS4", "Standard_GS4-4", "Standard_GS4-8", "Standard_GS5", + "Standard_GS5-16", "Standard_GS5-8", "Standard_H16", "Standard_H16m", "Standard_H16mr", + "Standard_H16r", "Standard_H8", "Standard_H8m", "Standard_L16s", "Standard_L32s", + "Standard_L4s", "Standard_L8s", "Standard_M128-32ms", "Standard_M128-64ms", "Standard_M128ms", + "Standard_M128s", "Standard_M64-16ms", "Standard_M64-32ms", "Standard_M64ms", "Standard_M64s", + "Standard_NC12", "Standard_NC12s_v2", "Standard_NC12s_v3", "Standard_NC24", "Standard_NC24r", + "Standard_NC24rs_v2", "Standard_NC24rs_v3", "Standard_NC24s_v2", "Standard_NC24s_v3", + "Standard_NC6", "Standard_NC6s_v2", "Standard_NC6s_v3", "Standard_ND12s", "Standard_ND24rs", + "Standard_ND24s", "Standard_ND6s", "Standard_NV12", "Standard_NV24", and "Standard_NV6". + :paramtype vm_size: str or + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ContainerServiceVMSizeTypes + :keyword os_disk_size_gb: OS Disk Size in GB to be used to specify the disk size for every + machine in this 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 vnet_subnet_id: VNet SubnetID specifies the VNet's subnet identifier. + :paramtype vnet_subnet_id: str + :keyword first_consecutive_static_ip: FirstConsecutiveStaticIP used to specify the first static + ip of masters. + :paramtype first_consecutive_static_ip: str + :keyword storage_profile: Storage profile specifies what kind of storage used. Choose from + StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the + orchestrator choice. Known values are: "StorageAccount" and "ManagedDisks". + :paramtype storage_profile: str or + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ContainerServiceStorageProfileTypes + """ + super().__init__(**kwargs) + self.count = count + self.dns_prefix = dns_prefix + self.vm_size = vm_size + self.os_disk_size_gb = os_disk_size_gb + self.vnet_subnet_id = vnet_subnet_id + self.first_consecutive_static_ip = first_consecutive_static_ip + self.storage_profile = storage_profile + self.fqdn = None + + +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.v2022_08_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.v2022_08_02_preview.models.NetworkPluginMode + :ivar network_policy: Network policy used for building the Kubernetes network. Known values + are: "calico" and "azure". + :vartype network_policy: str or + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.NetworkMode + :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 docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :vartype docker_bridge_cidr: 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.v2022_08_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.v2022_08_02_preview.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterLoadBalancerProfile + :ivar nat_gateway_profile: Profile of the cluster NAT gateway. + :vartype nat_gateway_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterNATGatewayProfile + :ivar pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each + IP family (IPv4/IPv6), is expected for dual-stack networking. + :vartype pod_cidrs: list[str] + :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.v2022_08_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.v2022_08_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig + """ + + _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]?)$" + }, + "docker_bridge_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, + } + + _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"}, + "pod_cidr": {"key": "podCidr", "type": "str"}, + "service_cidr": {"key": "serviceCidr", "type": "str"}, + "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, + "docker_bridge_cidr": {"key": "dockerBridgeCidr", "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"}, + "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"}, + } + + 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, + pod_cidr: str = "10.244.0.0/16", + service_cidr: str = "10.0.0.0/16", + dns_service_ip: str = "10.0.0.10", + docker_bridge_cidr: str = "172.17.0.1/16", + 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, + 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, + **kwargs + ): + """ + :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.v2022_08_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.v2022_08_02_preview.models.NetworkPluginMode + :keyword network_policy: Network policy used for building the Kubernetes network. Known values + are: "calico" and "azure". + :paramtype network_policy: str or + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.NetworkMode + :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 docker_bridge_cidr: A CIDR notation IP range assigned to the Docker bridge network. It + must not overlap with any Subnet IP ranges or the Kubernetes service address range. + :paramtype docker_bridge_cidr: 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.v2022_08_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.v2022_08_02_preview.models.LoadBalancerSku + :keyword load_balancer_profile: Profile of the cluster load balancer. + :paramtype load_balancer_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterLoadBalancerProfile + :keyword nat_gateway_profile: Profile of the cluster NAT gateway. + :paramtype nat_gateway_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterNATGatewayProfile + :keyword pod_cidrs: One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for + each IP family (IPv4/IPv6), is expected for dual-stack networking. + :paramtype pod_cidrs: list[str] + :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.v2022_08_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.v2022_08_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfig + """ + 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.pod_cidr = pod_cidr + self.service_cidr = service_cidr + self.dns_service_ip = dns_service_ip + self.docker_bridge_cidr = docker_bridge_cidr + 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.pod_cidrs = pod_cidrs + self.service_cidrs = service_cidrs + self.ip_families = ip_families + self.kube_proxy_config = kube_proxy_config + + +class ContainerServiceNetworkProfileKubeProxyConfig(_serialization.Model): + """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.v2022_08_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.v2022_08_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 + ): + """ + :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.v2022_08_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.v2022_08_02_preview.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + """ + super().__init__(**kwargs) + self.enabled = enabled + self.mode = mode + self.ipvs_config = ipvs_config + + +class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(_serialization.Model): + """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.v2022_08_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 + ): + """ + :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.v2022_08_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 Azure. + + :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.v2022_08_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): + """ + :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.v2022_08_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 Azure. + + :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): + """ + :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 ContainerServiceVMDiagnostics(_serialization.Model): + """Profile for diagnostics on the container service VMs. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar enabled: Whether the VM diagnostic agent is provisioned on the VM. Required. + :vartype enabled: bool + :ivar storage_uri: The URI of the storage account where diagnostics are stored. + :vartype storage_uri: str + """ + + _validation = { + "enabled": {"required": True}, + "storage_uri": {"readonly": True}, + } + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "storage_uri": {"key": "storageUri", "type": "str"}, + } + + def __init__(self, *, enabled: bool, **kwargs): + """ + :keyword enabled: Whether the VM diagnostic agent is provisioned on the VM. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + self.storage_uri = None + + +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): + """ + :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): + """ """ + 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.v2022_08_02_preview.models.CredentialResult] + """ + + _validation = { + "kubeconfigs": {"readonly": True}, + } + + _attribute_map = { + "kubeconfigs": {"key": "kubeconfigs", "type": "[CredentialResult]"}, + } + + def __init__(self, **kwargs): + """ """ + super().__init__(**kwargs) + self.kubeconfigs = None + + +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.v2022_08_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 + ): + """ + :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.v2022_08_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 + ): + """ + :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 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.v2022_08_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 + ): + """ + :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.v2022_08_02_preview.models.ExtendedLocationTypes + """ + super().__init__(**kwargs) + self.name = name + self.type = type + + +class GuardrailsProfile(_serialization.Model): + """The Guardrails 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 Azure. + + :ivar system_excluded_namespaces: List of namespaces specified by AKS to be excluded from + Guardrails. + :vartype system_excluded_namespaces: list[str] + :ivar version: The version of constraints to use. Required. + :vartype version: str + :ivar level: The guardrails level to be used. By default, Guardrails 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.v2022_08_02_preview.models.Level + :ivar excluded_namespaces: List of namespaces excluded from guardrails checks. + :vartype excluded_namespaces: list[str] + """ + + _validation = { + "system_excluded_namespaces": {"readonly": True}, + "version": {"required": 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, + *, + version: str, + level: Union[str, "_models.Level"], + excluded_namespaces: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword version: The version of constraints to use. Required. + :paramtype version: str + :keyword level: The guardrails level to be used. By default, Guardrails 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.v2022_08_02_preview.models.Level + :keyword excluded_namespaces: List of namespaces excluded from guardrails 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 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 + ): + """ + :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 LinuxOSConfig(_serialization.Model): + """See `AKS custom node configuration `_ for more details. + + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.v2022_08_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 + ): + """ + :keyword sysctls: Sysctl settings for Linux agent nodes. + :paramtype sysctls: ~azure.mgmt.containerservice.v2022_08_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 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.v2022_08_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.v2022_08_02_preview.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: + list[~azure.mgmt.containerservice.v2022_08_02_preview.models.TimeSpan] + """ + + _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]"}, + } + + def __init__( + self, + *, + time_in_week: Optional[List["_models.TimeInWeek"]] = None, + not_allowed_time: Optional[List["_models.TimeSpan"]] = None, + **kwargs + ): + """ + :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.v2022_08_02_preview.models.TimeInWeek] + :keyword not_allowed_time: Time slots on which upgrade is not allowed. + :paramtype not_allowed_time: + list[~azure.mgmt.containerservice.v2022_08_02_preview.models.TimeSpan] + """ + super().__init__(**kwargs) + self.system_data = None + self.time_in_week = time_in_week + self.not_allowed_time = not_allowed_time + + +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.v2022_08_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): + """ + :keyword value: The list of maintenance configurations. + :paramtype value: + list[~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +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. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2022_08_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): + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +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 Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2022_08_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): + """ + :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 Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ExtendedLocation + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterIdentity + :ivar provisioning_state: The current provisioning state. + :vartype provisioning_state: str + :ivar power_state: The Power State of the cluster. + :vartype power_state: ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_02_preview.models.ManagedClusterAgentPoolProfile] + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ContainerServiceLinuxProfile + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ManagedClusterServicePrincipalProfile + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ManagedClusterPodIdentityProfile + :ivar oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :vartype oidc_issuer_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterOIDCIssuerProfile + :ivar node_resource_group: The name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :vartype enable_pod_security_policy: bool + :ivar enable_namespace_resources: The default value is false. It can be enabled/disabled on + creation and updation 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.v2022_08_02_preview.models.ContainerServiceNetworkProfile + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAutoUpgradeProfile + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ManagedClusterAPIServerAccessProfile + :ivar disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :vartype disk_encryption_set_id: str + :ivar identity_profile: Identities associated with the cluster. + :vartype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2022_08_02_preview.models.UserAssignedIdentity] + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: + list[~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ManagedClusterHTTPProxyConfig + :ivar security_profile: Security profile for the managed cluster. + :vartype security_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSecurityProfile + :ivar storage_profile: Storage profile for the managed cluster. + :vartype storage_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterStorageProfile + :ivar ingress_profile: Ingress profile for the managed cluster. + :vartype ingress_profile: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.PublicNetworkAccess + :ivar workload_auto_scaler_profile: Workload Auto-scaler profile for the container service + cluster. + :vartype workload_auto_scaler_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterWorkloadAutoScalerProfile + :ivar azure_monitor_profile: Prometheus addon profile for the container service cluster. + :vartype azure_monitor_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAzureMonitorProfile + :ivar guardrails_profile: The guardrails profile holds all the guardrails information for a + given cluster. + :vartype guardrails_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.GuardrailsProfile + """ + + _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}, + } + + _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"}, + "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"}, + "enable_rbac": {"key": "properties.enableRBAC", "type": "bool"}, + "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"}, + "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"}, + "guardrails_profile": {"key": "properties.guardrailsProfile", "type": "GuardrailsProfile"}, + } + + 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, + 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, + enable_rbac: Optional[bool] = 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, + 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, + guardrails_profile: Optional["_models.GuardrailsProfile"] = None, + **kwargs + ): + """ + :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.v2022_08_02_preview.models.ManagedClusterSKU + :keyword extended_location: The extended location of the Virtual Machine. + :paramtype extended_location: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ExtendedLocation + :keyword identity: The identity of the managed cluster, if configured. + :paramtype identity: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterIdentity + :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.v2022_08_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.v2022_08_02_preview.models.ManagedClusterAgentPoolProfile] + :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. + :paramtype linux_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ContainerServiceLinuxProfile + :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. + :paramtype windows_profile: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ManagedClusterServicePrincipalProfile + :keyword addon_profiles: The profile of managed cluster add-on. + :paramtype addon_profiles: dict[str, + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ManagedClusterPodIdentityProfile + :keyword oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :paramtype oidc_issuer_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterOIDCIssuerProfile + :keyword node_resource_group: The name of the resource group containing agent pool nodes. + :paramtype node_resource_group: str + :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :paramtype enable_rbac: bool + :keyword enable_pod_security_policy: (DEPRECATING) Whether to enable Kubernetes pod security + policy (preview). This feature is set for removal on October 15th, 2020. Learn more at + aka.ms/aks/azpodpolicy. + :paramtype enable_pod_security_policy: bool + :keyword enable_namespace_resources: The default value is false. It can be enabled/disabled on + creation and updation 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.v2022_08_02_preview.models.ContainerServiceNetworkProfile + :keyword aad_profile: The Azure Active Directory configuration. + :paramtype aad_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAADProfile + :keyword auto_upgrade_profile: The auto upgrade configuration. + :paramtype auto_upgrade_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAutoUpgradeProfile + :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :paramtype auto_scaler_profile: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ManagedClusterAPIServerAccessProfile + :keyword disk_encryption_set_id: This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :paramtype disk_encryption_set_id: str + :keyword identity_profile: Identities associated with the cluster. + :paramtype identity_profile: dict[str, + ~azure.mgmt.containerservice.v2022_08_02_preview.models.UserAssignedIdentity] + :keyword private_link_resources: Private link resources associated with the cluster. + :paramtype private_link_resources: + list[~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ManagedClusterHTTPProxyConfig + :keyword security_profile: Security profile for the managed cluster. + :paramtype security_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSecurityProfile + :keyword storage_profile: Storage profile for the managed cluster. + :paramtype storage_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterStorageProfile + :keyword ingress_profile: Ingress profile for the managed cluster. + :paramtype ingress_profile: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.PublicNetworkAccess + :keyword workload_auto_scaler_profile: Workload Auto-scaler profile for the container service + cluster. + :paramtype workload_auto_scaler_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterWorkloadAutoScalerProfile + :keyword azure_monitor_profile: Prometheus addon profile for the container service cluster. + :paramtype azure_monitor_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAzureMonitorProfile + :keyword guardrails_profile: The guardrails profile holds all the guardrails information for a + given cluster. + :paramtype guardrails_profile: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.GuardrailsProfile + """ + super().__init__(tags=tags, location=location, **kwargs) + self.sku = sku + self.extended_location = extended_location + self.identity = identity + 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.enable_rbac = enable_rbac + 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.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.guardrails_profile = guardrails_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: The client AAD application ID. + :vartype client_app_id: str + :ivar server_app_id: The server AAD application ID. + :vartype server_app_id: str + :ivar server_app_secret: The server AAD application secret. + :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 + ): + """ + :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: The client AAD application ID. + :paramtype client_app_id: str + :keyword server_app_id: The server AAD application ID. + :paramtype server_app_id: str + :keyword server_app_secret: The server AAD application secret. + :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 Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2022_08_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 + ): + """ + :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 Azure. + + :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.v2022_08_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): + """ + :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 + ): + """ + :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 + """ + + _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 + ): + """ + :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__(resource_id=resource_id, client_id=client_id, object_id=object_id, **kwargs) + + +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.v2022_08_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.v2022_08_02_preview.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Known values are: + "OCIContainer" and "WasmWasi". + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2022_08_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}. + :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}. + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and + "Windows". + :vartype os_type: str or ~azure.mgmt.containerservice.v2022_08_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", + "CBLMariner", "Mariner", "Windows2019", and "Windows2022". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ScaleDownMode + :ivar type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" and + "AvailabilitySet". + :vartype type: str or ~azure.mgmt.containerservice.v2022_08_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" and "User". + :vartype mode: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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 deploys a daemonset and host services to + sync custom certificate authorities from a user-provided config map 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}. + :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.v2022_08_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.v2022_08_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 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.v2022_08_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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}. + 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.v2022_08_02_preview.models.AgentPoolWindowsProfile + """ + + _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"}, + "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]"}, + "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"}, + } + + 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, + 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, + 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, + **kwargs + ): + """ + :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.v2022_08_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.v2022_08_02_preview.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Known values are: + "OCIContainer" and "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2022_08_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}. + :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}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" + and "Windows". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2022_08_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", + "CBLMariner", "Mariner", "Windows2019", and "Windows2022". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ScaleDownMode + :keyword type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" and + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2022_08_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" and "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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 + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword enable_custom_ca_trust: When set to true, AKS deploys a daemonset and host services to + sync custom certificate authorities from a user-provided config map 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}. + :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.v2022_08_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.v2022_08_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 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.v2022_08_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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}. + 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.v2022_08_02_preview.models.AgentPoolWindowsProfile + """ + 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.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.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 + + +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 Azure. + + :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.v2022_08_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.v2022_08_02_preview.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Known values are: + "OCIContainer" and "WasmWasi". + :vartype workload_runtime: str or + ~azure.mgmt.containerservice.v2022_08_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}. + :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}. + :vartype pod_subnet_id: str + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and + "Windows". + :vartype os_type: str or ~azure.mgmt.containerservice.v2022_08_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", + "CBLMariner", "Mariner", "Windows2019", and "Windows2022". + :vartype os_sku: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ScaleDownMode + :ivar type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" and + "AvailabilitySet". + :vartype type: str or ~azure.mgmt.containerservice.v2022_08_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" and "User". + :vartype mode: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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 deploys a daemonset and host services to + sync custom certificate authorities from a user-provided config map 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}. + :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.v2022_08_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.v2022_08_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 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.v2022_08_02_preview.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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}. + 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.v2022_08_02_preview.models.AgentPoolWindowsProfile + :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"}, + "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]"}, + "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"}, + "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, + 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, + 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, + **kwargs + ): + """ + :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.v2022_08_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.v2022_08_02_preview.models.KubeletDiskType + :keyword workload_runtime: Determines the type of workload a node can run. Known values are: + "OCIContainer" and "WasmWasi". + :paramtype workload_runtime: str or + ~azure.mgmt.containerservice.v2022_08_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}. + :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}. + :paramtype pod_subnet_id: str + :keyword max_pods: The maximum number of pods that can run on a node. + :paramtype max_pods: int + :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" + and "Windows". + :paramtype os_type: str or ~azure.mgmt.containerservice.v2022_08_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", + "CBLMariner", "Mariner", "Windows2019", and "Windows2022". + :paramtype os_sku: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ScaleDownMode + :keyword type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets" and + "AvailabilitySet". + :paramtype type: str or ~azure.mgmt.containerservice.v2022_08_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" and "User". + :paramtype mode: str or ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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 + `_. + The default is false. + :paramtype enable_node_public_ip: bool + :keyword enable_custom_ca_trust: When set to true, AKS deploys a daemonset and host services to + sync custom certificate authorities from a user-provided config map 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}. + :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.v2022_08_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.v2022_08_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 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.v2022_08_02_preview.models.KubeletConfig + :keyword linux_os_config: The OS configuration of Linux agent nodes. + :paramtype linux_os_config: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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}. + 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.v2022_08_02_preview.models.AgentPoolWindowsProfile + :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, + 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, + 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, + **kwargs + ) + self.name = name + + +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 + ): + """ + :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.v2022_08_02_preview.models.UpgradeChannel + """ + + _attribute_map = { + "upgrade_channel": {"key": "upgradeChannel", "type": "str"}, + } + + def __init__(self, *, upgrade_channel: Optional[Union[str, "_models.UpgradeChannel"]] = None, **kwargs): + """ + :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.v2022_08_02_preview.models.UpgradeChannel + """ + super().__init__(**kwargs) + self.upgrade_channel = 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.v2022_08_02_preview.models.ManagedClusterAzureMonitorProfileMetrics + """ + + _attribute_map = { + "metrics": {"key": "metrics", "type": "ManagedClusterAzureMonitorProfileMetrics"}, + } + + def __init__(self, *, metrics: Optional["_models.ManagedClusterAzureMonitorProfileMetrics"] = None, **kwargs): + """ + :keyword metrics: Metrics profile for the prometheus service addon. + :paramtype metrics: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAzureMonitorProfileMetrics + """ + super().__init__(**kwargs) + self.metrics = metrics + + +class ManagedClusterAzureMonitorProfileKubeStateMetrics(_serialization.Model): + """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 + ): + """ + :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 Azure. + + :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.v2022_08_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 + ): + """ + :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.v2022_08_02_preview.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + """ + super().__init__(**kwargs) + self.enabled = enabled + self.kube_state_metrics = kube_state_metrics + + +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 + ): + """ + :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.v2022_08_02_preview.models.ResourceIdentityType + :ivar user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2022_08_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"}, + "user_assigned_identities": { + "key": "userAssignedIdentities", + "type": "{ManagedServiceIdentityUserAssignedIdentitiesValue}", + }, + } + + def __init__( + self, + *, + type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, + user_assigned_identities: Optional[ + Dict[str, "_models.ManagedServiceIdentityUserAssignedIdentitiesValue"] + ] = None, + **kwargs + ): + """ + :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.v2022_08_02_preview.models.ResourceIdentityType + :keyword user_assigned_identities: The keys must be ARM resource IDs in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + super().__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + 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.v2022_08_02_preview.models.ManagedClusterIngressProfileWebAppRouting + """ + + _attribute_map = { + "web_app_routing": {"key": "webAppRouting", "type": "ManagedClusterIngressProfileWebAppRouting"}, + } + + def __init__( + self, *, web_app_routing: Optional["_models.ManagedClusterIngressProfileWebAppRouting"] = None, **kwargs + ): + """ + :keyword web_app_routing: Web App Routing settings for the ingress profile. + :paramtype web_app_routing: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterIngressProfileWebAppRouting + """ + super().__init__(**kwargs) + self.web_app_routing = web_app_routing + + +class ManagedClusterIngressProfileWebAppRouting(_serialization.Model): + """Web App Routing settings for the ingress profile. + + :ivar enabled: Whether to enable Web App Routing. + :vartype enabled: bool + :ivar dns_zone_resource_id: Resource ID of the DNS Zone to be associated with the web app. Used + only when Web App Routing is enabled. + :vartype dns_zone_resource_id: str + """ + + _attribute_map = { + "enabled": {"key": "enabled", "type": "bool"}, + "dns_zone_resource_id": {"key": "dnsZoneResourceId", "type": "str"}, + } + + def __init__(self, *, enabled: Optional[bool] = None, dns_zone_resource_id: Optional[str] = None, **kwargs): + """ + :keyword enabled: Whether to enable Web App Routing. + :paramtype enabled: bool + :keyword dns_zone_resource_id: Resource ID of the DNS Zone to be associated with the web app. + Used only when Web App Routing is enabled. + :paramtype dns_zone_resource_id: str + """ + super().__init__(**kwargs) + self.enabled = enabled + self.dns_zone_resource_id = dns_zone_resource_id + + +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.v2022_08_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): + """ + :keyword value: The list of managed clusters. + :paramtype value: list[~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_02_preview.models.BackendPoolType + """ + + _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"}, + } + + 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", + **kwargs + ): + """ + :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. + :paramtype managed_outbound_i_ps: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :paramtype outbound_i_ps: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_02_preview.models.BackendPoolType + """ + super().__init__(**kwargs) + self.managed_outbound_i_ps = managed_outbound_i_ps + self.outbound_ip_prefixes = outbound_ip_prefixes + self.outbound_i_ps = outbound_i_ps + self.effective_outbound_i_ps = 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 + + +class ManagedClusterLoadBalancerProfileManagedOutboundIPs(_serialization.Model): + """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): + """ + :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): + """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.v2022_08_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): + """ + :keyword public_ip_prefixes: A list of public IP prefix resources. + :paramtype public_ip_prefixes: + list[~azure.mgmt.containerservice.v2022_08_02_preview.models.ResourceReference] + """ + super().__init__(**kwargs) + self.public_ip_prefixes = public_ip_prefixes + + +class ManagedClusterLoadBalancerProfileOutboundIPs(_serialization.Model): + """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.v2022_08_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): + """ + :keyword public_i_ps: A list of public IP resources. + :paramtype public_i_ps: + list[~azure.mgmt.containerservice.v2022_08_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): + """ + :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 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.v2022_08_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.v2022_08_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 + ): + """ + :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.v2022_08_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.v2022_08_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 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): + """ + :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 Azure. + + :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.v2022_08_02_preview.models.UserAssignedIdentity + :ivar provisioning_state: The current provisioning state of the pod identity. Known values are: + "Assigned", "Updating", "Deleting", and "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterPodIdentityProvisioningState + :ivar provisioning_info: + :vartype provisioning_info: + ~azure.mgmt.containerservice.v2022_08_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 + ): + """ + :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.v2022_08_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 Azure. + + :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): + """ + :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 + `_ + 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.v2022_08_02_preview.models.ManagedClusterPodIdentity] + :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. + :vartype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2022_08_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 + ): + """ + :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 + `_ + 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.v2022_08_02_preview.models.ManagedClusterPodIdentity] + :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. + :paramtype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.v2022_08_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): + """An error response from the pod identity provisioning. + + :ivar error: Details about the error. + :vartype error: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + + _attribute_map = { + "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningErrorBody"}, + } + + def __init__(self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs): + """ + :keyword error: Details about the error. + :paramtype error: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + super().__init__(**kwargs) + self.error = error + + +class ManagedClusterPodIdentityProvisioningErrorBody(_serialization.Model): + """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.v2022_08_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 + ): + """ + :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.v2022_08_02_preview.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + super().__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class ManagedClusterPodIdentityProvisioningInfo(_serialization.Model): + """ManagedClusterPodIdentityProvisioningInfo. + + :ivar error: Pod identity assignment error (if any). + :vartype error: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterPodIdentityProvisioningError + """ + + _attribute_map = { + "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningError"}, + } + + def __init__(self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningError"] = None, **kwargs): + """ + :keyword error: Pod identity assignment error (if any). + :paramtype error: + ~azure.mgmt.containerservice.v2022_08_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 Azure. + + :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.v2022_08_02_preview.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.v2022_08_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 + ): + """ + :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.v2022_08_02_preview.models.OSType + :keyword upgrades: List of orchestrator types and versions available for upgrade. + :paramtype upgrades: + list[~azure.mgmt.containerservice.v2022_08_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): + """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): + """ + :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 + """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 expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Known values are: "least-waste", "most-pods", "priority", and "random". + :vartype expander: str or ~azure.mgmt.containerservice.v2022_08_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"}, + "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, + 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 + ): + """ + :keyword balance_similar_node_groups: Valid values are 'true' and 'false'. + :paramtype balance_similar_node_groups: str + :keyword expander: If not specified, the default is 'random'. See `expanders + `_ + for more information. Known values are: "least-waste", "most-pods", "priority", and "random". + :paramtype expander: str or ~azure.mgmt.containerservice.v2022_08_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.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.v2022_08_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.v2022_08_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 + ): + """ + :keyword kubernetes_version: The current kubernetes version. + :paramtype kubernetes_version: str + :keyword sku: The current managed cluster sku. + :paramtype sku: ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_02_preview.models.AzureKeyVaultKms + :ivar workload_identity: `Workload Identity + `_ settings for the security profile. + :vartype workload_identity: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity + :ivar image_cleaner: ImageCleaner settings for the security profile. + :vartype image_cleaner: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSecurityProfileImageCleaner + :ivar node_restriction: `Node Restriction + `_ + settings for the security profile. + :vartype node_restriction: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSecurityProfileNodeRestriction + """ + + _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"}, + "node_restriction": {"key": "nodeRestriction", "type": "ManagedClusterSecurityProfileNodeRestriction"}, + } + + 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, + node_restriction: Optional["_models.ManagedClusterSecurityProfileNodeRestriction"] = None, + **kwargs + ): + """ + :keyword defender: Microsoft Defender settings for the security profile. + :paramtype defender: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_02_preview.models.AzureKeyVaultKms + :keyword workload_identity: `Workload Identity + `_ settings for the security profile. + :paramtype workload_identity: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSecurityProfileWorkloadIdentity + :keyword image_cleaner: ImageCleaner settings for the security profile. + :paramtype image_cleaner: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSecurityProfileImageCleaner + :keyword node_restriction: `Node Restriction + `_ + settings for the security profile. + :paramtype node_restriction: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSecurityProfileNodeRestriction + """ + 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.node_restriction = node_restriction + + +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.v2022_08_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 + ): + """ + :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.v2022_08_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): + """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): + """ + :keyword enabled: Whether to enable Defender threat detection. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileImageCleaner(_serialization.Model): + """ImageCleaner 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 ImageCleaner on AKS cluster. + :vartype enabled: bool + :ivar interval_hours: ImageCleaner scanning interval. + :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): + """ + :keyword enabled: Whether to enable ImageCleaner on AKS cluster. + :paramtype enabled: bool + :keyword interval_hours: ImageCleaner scanning interval. + :paramtype interval_hours: int + """ + super().__init__(**kwargs) + self.enabled = enabled + self.interval_hours = interval_hours + + +class ManagedClusterSecurityProfileNodeRestriction(_serialization.Model): + """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): + """ + :keyword enabled: Whether to enable Node Restriction. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterSecurityProfileWorkloadIdentity(_serialization.Model): + """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): + """ + :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 Azure. + + :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): + """ + :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. "Basic" + :vartype name: str or + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSKUName + :ivar tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Known values are: "Paid" + and "Free". + :vartype tier: str or + ~azure.mgmt.containerservice.v2022_08_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 + ): + """ + :keyword name: The name of a managed cluster SKU. "Basic" + :paramtype name: str or + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSKUName + :keyword tier: If not specified, the default is 'Free'. See `uptime SLA + `_ for more details. Known values are: "Paid" + and "Free". + :paramtype tier: str or + ~azure.mgmt.containerservice.v2022_08_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 Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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.v2022_08_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.v2022_08_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 + ): + """ + :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.v2022_08_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.v2022_08_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.v2022_08_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): + """ + :keyword value: The list of managed cluster snapshots. + :paramtype value: + list[~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +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.v2022_08_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver + :ivar file_csi_driver: AzureFile CSI Driver settings for the storage profile. + :vartype file_csi_driver: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterStorageProfileFileCSIDriver + :ivar snapshot_controller: Snapshot Controller settings for the storage profile. + :vartype snapshot_controller: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterStorageProfileSnapshotController + :ivar blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. + :vartype blob_csi_driver: + ~azure.mgmt.containerservice.v2022_08_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 + ): + """ + :keyword disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. + :paramtype disk_csi_driver: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterStorageProfileDiskCSIDriver + :keyword file_csi_driver: AzureFile CSI Driver settings for the storage profile. + :paramtype file_csi_driver: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterStorageProfileFileCSIDriver + :keyword snapshot_controller: Snapshot Controller settings for the storage profile. + :paramtype snapshot_controller: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterStorageProfileSnapshotController + :keyword blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. + :paramtype blob_csi_driver: + ~azure.mgmt.containerservice.v2022_08_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): + """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): + """ + :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): + """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): + """ + :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): + """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): + """ + :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): + """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): + """ + :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 Azure. + + :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.v2022_08_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.v2022_08_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 + ): + """ + :keyword control_plane_profile: The list of available upgrade versions for the control plane. + Required. + :paramtype control_plane_profile: + ~azure.mgmt.containerservice.v2022_08_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.v2022_08_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 Azure. + + :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.v2022_08_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.v2022_08_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 + ): + """ + :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.v2022_08_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.v2022_08_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 container service cluster. + + :ivar keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler + profile. + :vartype keda: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda + :ivar vertical_pod_autoscaler: + :vartype vertical_pod_autoscaler: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + """ + + _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 + ): + """ + :keyword keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler + profile. + :paramtype keda: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterWorkloadAutoScalerProfileKeda + :keyword vertical_pod_autoscaler: + :paramtype vertical_pod_autoscaler: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + """ + super().__init__(**kwargs) + self.keda = keda + self.vertical_pod_autoscaler = vertical_pod_autoscaler + + +class ManagedClusterWorkloadAutoScalerProfileKeda(_serialization.Model): + """KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + + All required parameters must be populated in order to send to Azure. + + :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): + """ + :keyword enabled: Whether to enable KEDA. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.enabled = enabled + + +class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler(_serialization.Model): + """ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler. + + All required parameters must be populated in order to send to Azure. + + :ivar enabled: Whether to enable VPA. Default value is false. Required. + :vartype enabled: bool + :ivar controlled_values: Controls which resource value autoscaler will change. Default value is + RequestsAndLimits. Known values are: "RequestsAndLimits" and "RequestsOnly". + :vartype controlled_values: str or + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ControlledValues + :ivar update_mode: Each update mode level is a superset of the lower levels. + Off`_. + :vartype rules: + list[~azure.mgmt.containerservice.v2022_08_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): + """ """ + 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 Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.containerservice.v2022_08_02_preview.models.SystemData + :ivar provisioning_state: The current provisioning state of trusted access role binding. Known + values are: "Succeeded", "Failed", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.v2022_08_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): + """ + :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.v2022_08_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): + """ + :keyword value: Role binding list. + :paramtype value: + list[~azure.mgmt.containerservice.v2022_08_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.v2022_08_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): + """ """ + 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): + """ """ + super().__init__(**kwargs) + self.verbs = None + self.api_groups = None + self.resources = None + self.resource_names = None + self.non_resource_ur_ls = None + + +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 + ): + """ + :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/v2022_08_02_preview/models/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/models/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_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/v2022_08_02_preview/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/__init__.py new file mode 100644 index 000000000000..6a931af99fa3 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/__init__.py @@ -0,0 +1,39 @@ +# 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 ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations +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 * # type: ignore # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "Operations", + "ManagedClustersOperations", + "MaintenanceConfigurationsOperations", + "AgentPoolsOperations", + "PrivateEndpointConnectionsOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "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/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 new file mode 100644 index 000000000000..19d5eaf773a5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_agent_pools_operations.py @@ -0,0 +1,1245 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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, _format_url_section + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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_available_agent_pool_versions_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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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"), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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.v2022_08_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") + + @distributed_trace + def abort_latest_operation( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> None: + """Aborts last operation running on agent pool. + + Aborting last running operation on agent pool. We return a 204 no content code here to indicate + that the operation has been accepted and an abort will be attempted but is not guaranteed to + complete successfully. Please look up the provisioning state of the agent pool to keep track of + whether it changes to Canceled. A canceled provisioning state indicates that the abort was + successful. + + :param resource_group_name: The name of the resource group. The name is 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.abort_latest_operation.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [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, {}) + + abort_latest_operation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AgentPool or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPool or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] + + 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, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: Union[_models.AgentPool, IO], + **kwargs: Any + ) -> _models.AgentPool: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self._create_or_update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + return deserialized + + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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], + **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 model type or a IO type. + Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPool] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( # type: ignore + 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, {}) + return deserialized + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # 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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPoolUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolUpgradeProfile] + + 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, + template_url=self.get_upgrade_profile.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get_upgrade_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AgentPoolAvailableVersions or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPoolAvailableVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.AgentPoolAvailableVersions] + + 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, + template_url=self.get_available_agent_pool_versions.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get_available_agent_pool_versions.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions"} # 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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.AgentPool]] + + 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, + template_url=self._upgrade_node_image_version_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + return deserialized + + _upgrade_node_image_version_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # 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[None]: + """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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_02_preview.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._upgrade_node_image_version_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): + 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) + return deserialized + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_upgrade_node_image_version.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion"} # type: ignore 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 new file mode 100644 index 000000000000..8d20561f7b71 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_maintenance_configurations_operations.py @@ -0,0 +1,592 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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, _format_url_section + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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.v2022_08_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") + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MaintenanceConfiguration or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfigurationListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_managed_cluster.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list_by_managed_cluster.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfiguration] + + 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, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], + **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 model type or + a IO type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MaintenanceConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.MaintenanceConfiguration] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.delete.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}"} # type: ignore 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 new file mode 100644 index 000000000000..785d3d3c01a1 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_cluster_snapshots_operations.py @@ -0,0 +1,848 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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, _format_url_section + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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.v2022_08_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") + + @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. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedClusterSnapshot or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshotListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] + + request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], + **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 model type or + a IO type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], **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 model type or a IO type. Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterSnapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterSnapshot] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.update_tags.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.delete.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}"} # type: ignore 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 new file mode 100644 index 000000000000..3c4873537cc4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_managed_clusters_operations.py @@ -0,0 +1,3459 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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, _format_url_section + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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_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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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( + 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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.v2022_08_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") + + @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 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OSOptionProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.OSOptionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OSOptionProfile] + + request = build_get_os_options_request( + location=location, + subscription_id=self._config.subscription_id, + resource_type=resource_type, + api_version=api_version, + template_url=self.get_os_options.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get_os_options.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default"} # 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. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedCluster or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ManagedCluster or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterUpgradeProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterUpgradeProfile] + + 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, + template_url=self.get_upgrade_profile.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get_upgrade_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedClusterAccessProfile or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAccessProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedClusterAccessProfile] + + 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, + template_url=self.get_access_profile.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get_access_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] + + 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, + template_url=self.list_cluster_admin_credentials.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + list_cluster_admin_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential"} # 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.v2022_08_02_preview.models.Format + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] + + 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, + template_url=self.list_cluster_user_credentials.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + list_cluster_user_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CredentialResults or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.CredentialResults] + + 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, + template_url=self.list_cluster_monitoring_user_credentials.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + list_cluster_monitoring_user_credentials.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ManagedCluster or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + + request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore + + def _create_or_update_initial( + self, resource_group_name: str, resource_name: str, parameters: Union[_models.ManagedCluster, IO], **kwargs: Any + ) -> _models.ManagedCluster: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self._create_or_update_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + return deserialized + + _create_or_update_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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], **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 model type or a IO + type. Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_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): + deserialized = self._deserialize("ManagedCluster", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # type: ignore + + def _update_tags_initial( + self, resource_group_name: str, resource_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any + ) -> _models.ManagedCluster: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self._update_tags_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + _update_tags_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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], **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 model type or a IO type. Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ManagedCluster or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.ManagedCluster] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_tags_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): + deserialized = self._deserialize("ManagedCluster", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # 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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}"} # 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], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self._reset_service_principal_profile_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _reset_service_principal_profile_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either 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], + **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 + model type or a IO type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterServicePrincipalProfile + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_reset_service_principal_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile"} # 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], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self._reset_aad_profile_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _reset_aad_profile_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # 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. + + Reset the AAD 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 + :param parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + Reset the AAD 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 + :param parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either 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], + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + Reset the AAD 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 + :param parameters: The AAD profile to set on the Managed Cluster. Is either a model type or a + IO type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.ManagedClusterAADProfile or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_reset_aad_profile.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile"} # type: ignore + + @distributed_trace + def abort_latest_operation( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Aborts last operation running on managed cluster. + + Aborting last running operation on managed cluster. We return a 204 no content code here to + indicate that the operation has been accepted and an abort will be attempted but is not + guaranteed to complete successfully. Please look up the provisioning state of the managed + cluster to keep track of whether it changes to Canceled. A canceled provisioning state + indicates that the abort was successful. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.abort_latest_operation.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [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, {}) + + abort_latest_operation.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort"} # 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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._rotate_cluster_certificates_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _rotate_cluster_certificates_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_rotate_cluster_certificates.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates"} # type: ignore + + def _rotate_service_account_signing_keys_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._rotate_service_account_signing_keys_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _rotate_service_account_signing_keys_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore + + @distributed_trace + def begin_rotate_service_account_signing_keys( + 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_rotate_service_account_signing_keys.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys"} # type: ignore + + def _stop_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._stop_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _stop_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_stop.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop"} # type: ignore + + def _start_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._start_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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) + + if cls: + return cls(pipeline_response, None, {}) + + _start_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_start.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start"} # type: ignore + + def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, IO], + **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(request_payload, (IO, 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, + template_url=self._run_command_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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 + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _run_command_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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], + **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 model type or a IO type. Required. + :type request_payload: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.RunCommandRequest or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either RunCommandResult or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.v2022_08_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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.RunCommandResult] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + if cont_token is None: + raw_result = self._run_command_initial( # type: ignore + 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, {}) + return deserialized + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_run_command.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RunCommandResult or None or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.RunCommandResult or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[Optional[_models.RunCommandResult]] + + 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, + template_url=self.get_command_result.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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 + if response.status_code == 200: + deserialized = self._deserialize("RunCommandResult", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_command_result.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}"} # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( + 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OutboundEnvironmentEndpoint or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.OutboundEnvironmentEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OutboundEnvironmentEndpointCollection] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_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, + template_url=self.list_outbound_network_dependencies_endpoints.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list_outbound_network_dependencies_endpoints.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints"} # type: ignore 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 new file mode 100644 index 000000000000..be008a258a1c --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_operations.py @@ -0,0 +1,149 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse + +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 + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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.v2022_08_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") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.OperationValue"]: + """Gets a list of operations. + + Gets a list of operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationValue or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.OperationValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.OperationListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/providers/Microsoft.ContainerService/operations"} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_patch.py new file mode 100644 index 000000000000..f7dd32510333 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_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/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 new file mode 100644 index 000000000000..1b0ff8fda3a5 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,643 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Optional, 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, _format_url_section + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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.v2022_08_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") + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnectionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnectionListResult] + + request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] + + 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, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], + **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 model type or a IO + type. Required. + :type parameters: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnection or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateEndpointConnection] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # 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 = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + _delete_initial.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[None] + polling = kwargs.pop("polling", True) # type: Union[bool, PollingMethod] + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token = kwargs.pop("continuation_token", None) # type: Optional[str] + 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, {}) + + if polling is True: + polling_method = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) # type: PollingMethod + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore 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 new file mode 100644 index 000000000000..ad072f0d6c75 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_private_link_resources_operations.py @@ -0,0 +1,158 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, 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, _format_url_section + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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.v2022_08_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") + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourcesListResult or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResourcesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResourcesListResult] + + request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources"} # type: ignore 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 new file mode 100644 index 000000000000..8a4a3c2cffd8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_resolve_private_link_service_id_operations.py @@ -0,0 +1,243 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Optional, 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, _format_url_section + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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.v2022_08_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") + + @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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], + **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 model type or a IO type. Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResource + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.PrivateLinkResource] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.post.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + post.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId"} # type: ignore 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 new file mode 100644 index 000000000000..e73117415ee4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_snapshots_operations.py @@ -0,0 +1,834 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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, _format_url_section + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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.v2022_08_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") + + @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. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Snapshot or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either Snapshot or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.SnapshotListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list_by_resource_group.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] + + request = build_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], **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 model type or a IO type. + Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # 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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO, + *, + 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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_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], **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 model + type or a IO type. Required. + :type parameters: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Snapshot or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.Snapshot] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IO, 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, + template_url=self.update_tags.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + update_tags.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.delete.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}"} # type: ignore 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 new file mode 100644 index 000000000000..efd744af7f6b --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_role_bindings_operations.py @@ -0,0 +1,610 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +from urllib.parse import parse_qs, urljoin, urlparse + +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, _format_url_section + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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 = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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=36, min_length=1 + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + 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", min_length=1), + "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=36, min_length=1 + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "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=36, min_length=1 + ), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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.v2022_08_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") + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TrustedAccessRoleBinding or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBindingListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings"} # type: ignore + + @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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrustedAccessRoleBinding or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBinding] + + 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, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore + + @overload + def 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 + ) -> _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.v2022_08_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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrustedAccessRoleBinding or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _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 + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrustedAccessRoleBinding or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def 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], + **kwargs: Any + ) -> _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 model type or a + IO type. Required. + :type trusted_access_role_binding: + ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TrustedAccessRoleBinding or the result of cls(response) + :rtype: ~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str] + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleBinding] + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(trusted_access_role_binding, (IO, 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, + template_url=self.create_or_update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_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, {}) + + return deserialized + + create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> 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 + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[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, + template_url=self.delete.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **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, {}) + + delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}"} # type: ignore 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 new file mode 100644 index 000000000000..c69ee1d650d1 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/operations/_trusted_access_roles_operations.py @@ -0,0 +1,162 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +from urllib.parse import parse_qs, urljoin, urlparse + +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, _format_url_section + +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 = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + 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", min_length=1), + "location": _SERIALIZER.url("location", location, "str", min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # 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.v2022_08_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") + + @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 Azure region. Required. + :type location: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TrustedAccessRole or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.v2022_08_02_preview.models.TrustedAccessRole] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version = kwargs.pop("api_version", _params.pop("api-version", "2022-08-02-preview")) # type: str + cls = kwargs.pop("cls", None) # type: ClsType[_models.TrustedAccessRoleListResult] + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + + else: + # make call to next link with the client's api-version + _parsed_next_link = urlparse(next_link) + _next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query)) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params) + request = _convert_request(request) + request.url = self._client.format_url(request.url) # type: ignore + 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) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=False, **kwargs + ) + response = pipeline_response.http_response + + if response.status_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) + + list.metadata = {"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles"} # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/py.typed b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_08_02_preview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file