diff --git a/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md b/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md index 034afd30267f..9062639e3532 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md +++ b/sdk/containerservice/azure-mgmt-containerservice/CHANGELOG.md @@ -1,5 +1,66 @@ # Release History +## 41.0.0b4 (2026-03-10) + +### Features Added + + - Client `ContainerServiceClient` added method `send_request` + - Model `AgentPool` added property `properties` + - Model `AgentPool` added property `system_data` + - Model `AgentPoolUpgradeProfile` added property `system_data` + - Enum `Format` added member `EXECEnum` + - Model `LabelSelectorRequirement` added property `values_property` + - Model `Machine` added property `system_data` + - Model `ManagedClusterAccessProfile` added property `properties` + - Model `ManagedClusterUpgradeProfile` added property `system_data` + - Model `OperationValue` added property `display` + - Enum `Operator` added member `INEnum` + - Model `PrivateEndpointConnection` added property `system_data` + - Model `RunCommandResult` added property `properties` + - Added model `AccessProfile` + - Added model `CommandResultProperties` + - Added model `OperationValueDisplay` + - Operation group `AgentPoolsOperations` added parameter `etag` in method `begin_create_or_update` + - Operation group `AgentPoolsOperations` added parameter `match_condition` in method `begin_create_or_update` + - Operation group `AgentPoolsOperations` added parameter `etag` in method `begin_delete` + - Operation group `AgentPoolsOperations` added parameter `match_condition` in method `begin_delete` + - Operation group `MachinesOperations` added parameter `etag` in method `begin_create_or_update` + - Operation group `MachinesOperations` added parameter `match_condition` in method `begin_create_or_update` + - Operation group `ManagedClustersOperations` added parameter `etag` in method `begin_create_or_update` + - Operation group `ManagedClustersOperations` added parameter `match_condition` in method `begin_create_or_update` + - Operation group `ManagedClustersOperations` added parameter `etag` in method `begin_delete` + - Operation group `ManagedClustersOperations` added parameter `match_condition` in method `begin_delete` + - Operation group `ManagedClustersOperations` added parameter `etag` in method `begin_update_tags` + - Operation group `ManagedClustersOperations` added parameter `match_condition` in method `begin_update_tags` + +### Breaking Changes + + - This version introduces new hybrid models which have dual dictionary and model nature. Please follow https://aka.ms/azsdk/python/migrate/hybrid-models for migration. + - For the method breakings, please refer to https://aka.ms/azsdk/python/migrate/operations for migration. + - Deleted or renamed enum value `Format.EXEC` + - Deleted or renamed enum value `Operator.IN` + - Model `AgentPool` moved instance variables `e_tag`, `count`, `vm_size`, `os_disk_size_gb`, `os_disk_type`, `kubelet_disk_type`, `workload_runtime`, `message_of_the_day`, `vnet_subnet_id`, `pod_subnet_id`, `pod_ip_allocation_mode`, `max_pods`, `os_type`, `os_sku`, `max_count`, `min_count`, `enable_auto_scaling`, `scale_down_mode`, `type_properties_type`, `mode`, `orchestrator_version`, `current_orchestrator_version`, `node_image_version`, `upgrade_strategy`, `upgrade_settings`, `upgrade_settings_blue_green`, `provisioning_state`, `power_state`, `availability_zones`, `enable_node_public_ip`, `node_public_ip_prefix_id`, `scale_set_priority`, `scale_set_eviction_policy`, `spot_max_price`, `tags`, `node_labels`, `node_taints`, `node_initialization_taints`, `proximity_placement_group_id`, `kubelet_config`, `linux_os_config`, `enable_encryption_at_host`, `enable_ultra_ssd`, `enable_fips`, `gpu_instance_profile`, `creation_data`, `capacity_reservation_group_id`, `host_group_id`, `windows_profile`, `network_profile`, `security_profile`, `gpu_profile`, `artifact_streaming_profile`, `virtual_machines_profile`, `virtual_machine_nodes_status`, `gateway_profile`, `status`, `local_dns_profile` and `node_customization_profile` under property `properties` + - Model `KubernetesVersionListResult` renamed its instance variable `values` to `values_property` + - Model `LabelSelectorRequirement` renamed its instance variable `values` to `values_property` + - Model `ManagedClusterAccessProfile` moved its instance variable `kube_config` under property `properties` + - Model `OperationValue` moved instance variables `operation`, `resource`, `description` and `provider` under property `display` + - Model `RunCommandResult` moved instance variables `provisioning_state`, `exit_code`, `started_at`, `finished_at`, `logs` and `reason` under property `properties` + - Method `AgentPoolsOperations.begin_delete` changed its parameter `ignore_pod_disruption_budget` from `positional_or_keyword` to `keyword_only` + - Method `MachinesOperations.begin_create_or_update` replaced positional_or_keyword parameters `if_match`/`if_none_match` with keyword_only parameters `etag`/`match_condition` + - Method `ManagedClustersOperations.begin_create_or_update` replaced positional_or_keyword parameters `if_match`/`if_none_match` with keyword_only parameters `etag`/`match_condition` + - Method `AgentPoolsOperations.begin_create_or_update` replaced positional_or_keyword parameters `if_match`/`if_none_match` with keyword_only parameters `etag`/`match_condition` + - Method `ManagedClustersOperations.begin_delete` changed its parameter `ignore_pod_disruption_budget` from `positional_or_keyword` to `keyword_only` + - Method `AgentPoolsOperations.begin_delete` replaced positional_or_keyword parameter `if_match` with keyword_only parameters `etag`/`match_condition` + - Method `ManagedClustersOperations.begin_delete` replaced positional_or_keyword parameter `if_match` with keyword_only parameters `etag`/`match_condition` + - Method `ManagedClustersOperations.begin_update_tags` replaced positional_or_keyword parameter `if_match` with keyword_only parameters `etag`/`match_condition` + - Method `ManagedClustersOperations.list_cluster_admin_credentials` changed its parameter `server_fqdn` from `positional_or_keyword` to `keyword_only` + - Method `ManagedClustersOperations.list_cluster_monitoring_user_credentials` changed its parameter `server_fqdn` from `positional_or_keyword` to `keyword_only` + - Method `ManagedClustersOperations.list_cluster_user_credentials` changed its parameters `server_fqdn`/`format` from `positional_or_keyword` to `keyword_only` + +### Other Changes + + - Deleted models `GuardrailsAvailableVersionsList`/`MeshRevisionProfileList`/`MeshUpgradeProfileList`/`OperationStatusResultList`/`OutboundEnvironmentEndpointCollection`/`SafeguardsAvailableVersionsList`/`SubResource` which actually were not used by SDK users + ## 41.0.0b3 (2025-12-22) ### Features Added diff --git a/sdk/containerservice/azure-mgmt-containerservice/_metadata.json b/sdk/containerservice/azure-mgmt-containerservice/_metadata.json index ef26a74b9084..0afb1d45a9c3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/_metadata.json +++ b/sdk/containerservice/azure-mgmt-containerservice/_metadata.json @@ -1,11 +1,10 @@ { - "commit": "2190549a182dc973a20692a138590a50326ac4a4", + "apiVersion": "2025-10-02-preview", + "apiVersions": { + "Microsoft.ContainerService": "2025-10-02-preview" + }, + "commit": "1bb32d7aaddc51af16d9e563d910ecec6921fae0", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.43.0", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-preview-2025-10 --use=@autorest/python@6.43.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", - "readme": "specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md" + "typespec_src": "specification/containerservice/resource-manager/Microsoft.ContainerService/aks", + "emitterVersion": "0.60.2" } \ No newline at end of file diff --git a/sdk/containerservice/azure-mgmt-containerservice/apiview-properties.json b/sdk/containerservice/azure-mgmt-containerservice/apiview-properties.json index ce527bd51838..997ddef01c72 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/apiview-properties.json +++ b/sdk/containerservice/azure-mgmt-containerservice/apiview-properties.json @@ -1,531 +1,522 @@ { - "CrossLanguagePackageId": null, + "CrossLanguagePackageId": "Microsoft.ContainerService", "CrossLanguageDefinitionId": { - "azure.mgmt.containerservice.models.AbsoluteMonthlySchedule": null, - "azure.mgmt.containerservice.models.AdvancedNetworking": null, - "azure.mgmt.containerservice.models.AdvancedNetworkingObservability": null, - "azure.mgmt.containerservice.models.AdvancedNetworkingPerformance": null, - "azure.mgmt.containerservice.models.AdvancedNetworkingSecurity": null, - "azure.mgmt.containerservice.models.AdvancedNetworkingSecurityTransitEncryption": null, - "azure.mgmt.containerservice.models.SubResource": null, - "azure.mgmt.containerservice.models.AgentPool": null, - "azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile": null, - "azure.mgmt.containerservice.models.AgentPoolAvailableVersions": null, - "azure.mgmt.containerservice.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem": null, - "azure.mgmt.containerservice.models.AgentPoolBlueGreenUpgradeSettings": null, - "azure.mgmt.containerservice.models.AgentPoolDeleteMachinesParameter": null, - "azure.mgmt.containerservice.models.AgentPoolGatewayProfile": null, - "azure.mgmt.containerservice.models.AgentPoolListResult": null, - "azure.mgmt.containerservice.models.AgentPoolNetworkProfile": null, - "azure.mgmt.containerservice.models.AgentPoolRecentlyUsedVersion": null, - "azure.mgmt.containerservice.models.AgentPoolSecurityProfile": null, - "azure.mgmt.containerservice.models.AgentPoolStatus": null, - "azure.mgmt.containerservice.models.AgentPoolUpgradeProfile": null, - "azure.mgmt.containerservice.models.AgentPoolUpgradeProfilePropertiesUpgradesItem": null, - "azure.mgmt.containerservice.models.AgentPoolUpgradeSettings": null, - "azure.mgmt.containerservice.models.AgentPoolWindowsProfile": null, - "azure.mgmt.containerservice.models.AutoScaleProfile": null, - "azure.mgmt.containerservice.models.AzureKeyVaultKms": null, - "azure.mgmt.containerservice.models.ClusterUpgradeSettings": null, - "azure.mgmt.containerservice.models.CompatibleVersions": null, - "azure.mgmt.containerservice.models.Component": null, - "azure.mgmt.containerservice.models.ComponentsByRelease": null, - "azure.mgmt.containerservice.models.ContainerServiceLinuxProfile": null, - "azure.mgmt.containerservice.models.ContainerServiceNetworkProfile": null, - "azure.mgmt.containerservice.models.ContainerServiceNetworkProfileKubeProxyConfig": null, - "azure.mgmt.containerservice.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig": null, - "azure.mgmt.containerservice.models.ContainerServiceSshConfiguration": null, - "azure.mgmt.containerservice.models.ContainerServiceSshPublicKey": null, - "azure.mgmt.containerservice.models.CreationData": null, - "azure.mgmt.containerservice.models.CredentialResult": null, - "azure.mgmt.containerservice.models.CredentialResults": null, - "azure.mgmt.containerservice.models.DailySchedule": null, - "azure.mgmt.containerservice.models.DateSpan": null, - "azure.mgmt.containerservice.models.DelegatedResource": null, - "azure.mgmt.containerservice.models.EndpointDependency": null, - "azure.mgmt.containerservice.models.EndpointDetail": null, - "azure.mgmt.containerservice.models.ErrorAdditionalInfo": null, - "azure.mgmt.containerservice.models.ErrorDetail": null, - "azure.mgmt.containerservice.models.ErrorResponse": null, - "azure.mgmt.containerservice.models.ExtendedLocation": null, - "azure.mgmt.containerservice.models.GPUProfile": null, - "azure.mgmt.containerservice.models.Resource": null, - "azure.mgmt.containerservice.models.GuardrailsAvailableVersion": null, - "azure.mgmt.containerservice.models.GuardrailsAvailableVersionsList": null, - "azure.mgmt.containerservice.models.GuardrailsAvailableVersionsProperties": null, - "azure.mgmt.containerservice.models.ProxyResource": null, - "azure.mgmt.containerservice.models.IdentityBinding": null, - "azure.mgmt.containerservice.models.IdentityBindingListResult": null, - "azure.mgmt.containerservice.models.IdentityBindingManagedIdentityProfile": null, - "azure.mgmt.containerservice.models.IdentityBindingOidcIssuerProfile": null, - "azure.mgmt.containerservice.models.IdentityBindingProperties": null, - "azure.mgmt.containerservice.models.IPTag": null, - "azure.mgmt.containerservice.models.IstioCertificateAuthority": null, - "azure.mgmt.containerservice.models.IstioComponents": null, - "azure.mgmt.containerservice.models.IstioEgressGateway": null, - "azure.mgmt.containerservice.models.IstioIngressGateway": null, - "azure.mgmt.containerservice.models.IstioPluginCertificateAuthority": null, - "azure.mgmt.containerservice.models.IstioServiceMesh": null, - "azure.mgmt.containerservice.models.JWTAuthenticator": null, - "azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression": null, - "azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappings": null, - "azure.mgmt.containerservice.models.JWTAuthenticatorExtraClaimMappingExpression": null, - "azure.mgmt.containerservice.models.JWTAuthenticatorIssuer": null, - "azure.mgmt.containerservice.models.JWTAuthenticatorListResult": null, - "azure.mgmt.containerservice.models.JWTAuthenticatorProperties": null, - "azure.mgmt.containerservice.models.JWTAuthenticatorValidationRule": null, - "azure.mgmt.containerservice.models.KubeletConfig": null, - "azure.mgmt.containerservice.models.KubernetesPatchVersion": null, - "azure.mgmt.containerservice.models.KubernetesResourceObjectEncryptionProfile": null, - "azure.mgmt.containerservice.models.KubernetesVersion": null, - "azure.mgmt.containerservice.models.KubernetesVersionCapabilities": null, - "azure.mgmt.containerservice.models.KubernetesVersionListResult": null, - "azure.mgmt.containerservice.models.LabelSelector": null, - "azure.mgmt.containerservice.models.LabelSelectorRequirement": null, - "azure.mgmt.containerservice.models.LinuxOSConfig": null, - "azure.mgmt.containerservice.models.LoadBalancer": null, - "azure.mgmt.containerservice.models.LoadBalancerListResult": null, - "azure.mgmt.containerservice.models.LocalDNSOverride": null, - "azure.mgmt.containerservice.models.LocalDNSProfile": null, - "azure.mgmt.containerservice.models.Machine": null, - "azure.mgmt.containerservice.models.MachineHardwareProfile": null, - "azure.mgmt.containerservice.models.MachineIpAddress": null, - "azure.mgmt.containerservice.models.MachineKubernetesProfile": null, - "azure.mgmt.containerservice.models.MachineListResult": null, - "azure.mgmt.containerservice.models.MachineNetworkProperties": null, - "azure.mgmt.containerservice.models.MachineOSProfile": null, - "azure.mgmt.containerservice.models.MachineOSProfileLinuxProfile": null, - "azure.mgmt.containerservice.models.MachineProperties": null, - "azure.mgmt.containerservice.models.MachineSecurityProfile": null, - "azure.mgmt.containerservice.models.MachineStatus": null, - "azure.mgmt.containerservice.models.MaintenanceConfiguration": null, - "azure.mgmt.containerservice.models.MaintenanceConfigurationListResult": null, - "azure.mgmt.containerservice.models.MaintenanceWindow": null, - "azure.mgmt.containerservice.models.TrackedResource": null, - "azure.mgmt.containerservice.models.ManagedCluster": null, - "azure.mgmt.containerservice.models.ManagedClusterAADProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterAccessProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterAddonProfile": null, - "azure.mgmt.containerservice.models.UserAssignedIdentity": null, - "azure.mgmt.containerservice.models.ManagedClusterAddonProfileIdentity": null, - "azure.mgmt.containerservice.models.ManagedClusterAgentPoolProfileProperties": null, - "azure.mgmt.containerservice.models.ManagedClusterAgentPoolProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterAIToolchainOperatorProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterAPIServerAccessProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterAutoUpgradeProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoring": null, - "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation": null, - "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs": null, - "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics": null, - "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileContainerInsights": null, - "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileKubeStateMetrics": null, - "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileMetrics": null, - "azure.mgmt.containerservice.models.ManagedClusterBootstrapProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterCostAnalysis": null, - "azure.mgmt.containerservice.models.ManagedClusterHostedSystemProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterHTTPProxyConfig": null, - "azure.mgmt.containerservice.models.ManagedClusterIdentity": null, - "azure.mgmt.containerservice.models.ManagedClusterIngressDefaultDomainProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterIngressProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterIngressProfileApplicationLoadBalancer": null, - "azure.mgmt.containerservice.models.ManagedClusterIngressProfileGatewayConfiguration": null, - "azure.mgmt.containerservice.models.ManagedClusterIngressProfileNginx": null, - "azure.mgmt.containerservice.models.ManagedClusterIngressProfileWebAppRouting": null, - "azure.mgmt.containerservice.models.ManagedClusterListResult": null, - "azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs": null, - "azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes": null, - "azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileOutboundIPs": null, - "azure.mgmt.containerservice.models.ManagedClusterManagedOutboundIPProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterMetricsProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterNATGatewayProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterNodeProvisioningProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterNodeResourceGroupProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterOIDCIssuerProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterPodIdentity": null, - "azure.mgmt.containerservice.models.ManagedClusterPodIdentityException": null, - "azure.mgmt.containerservice.models.ManagedClusterPodIdentityProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningError": null, - "azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningErrorBody": null, - "azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningInfo": null, - "azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfileUpgradesItem": null, - "azure.mgmt.containerservice.models.ManagedClusterPropertiesAutoScalerProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterPropertiesForSnapshot": null, - "azure.mgmt.containerservice.models.ManagedClusterSecurityProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefender": null, - "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityGating": null, - "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem": null, - "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring": null, - "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileImageCleaner": null, - "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileImageIntegrity": null, - "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileNodeRestriction": null, - "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileWorkloadIdentity": null, - "azure.mgmt.containerservice.models.ManagedClusterServicePrincipalProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterSKU": null, - "azure.mgmt.containerservice.models.ManagedClusterSnapshot": null, - "azure.mgmt.containerservice.models.ManagedClusterSnapshotListResult": null, - "azure.mgmt.containerservice.models.ManagedClusterStaticEgressGatewayProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterStatus": null, - "azure.mgmt.containerservice.models.ManagedClusterStorageProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterStorageProfileBlobCSIDriver": null, - "azure.mgmt.containerservice.models.ManagedClusterStorageProfileDiskCSIDriver": null, - "azure.mgmt.containerservice.models.ManagedClusterStorageProfileFileCSIDriver": null, - "azure.mgmt.containerservice.models.ManagedClusterStorageProfileSnapshotController": null, - "azure.mgmt.containerservice.models.ManagedClusterUpgradeProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterWindowsProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfile": null, - "azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfileKeda": null, - "azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler": null, - "azure.mgmt.containerservice.models.ManagedNamespace": null, - "azure.mgmt.containerservice.models.ManagedNamespaceListResult": null, - "azure.mgmt.containerservice.models.ManagedServiceIdentityUserAssignedIdentitiesValue": null, - "azure.mgmt.containerservice.models.ManualScaleProfile": null, - "azure.mgmt.containerservice.models.MeshMembership": null, - "azure.mgmt.containerservice.models.MeshMembershipProperties": null, - "azure.mgmt.containerservice.models.MeshMembershipsListResult": null, - "azure.mgmt.containerservice.models.MeshRevision": null, - "azure.mgmt.containerservice.models.MeshRevisionProfile": null, - "azure.mgmt.containerservice.models.MeshRevisionProfileList": null, - "azure.mgmt.containerservice.models.MeshRevisionProfileProperties": null, - "azure.mgmt.containerservice.models.MeshUpgradeProfile": null, - "azure.mgmt.containerservice.models.MeshUpgradeProfileList": null, - "azure.mgmt.containerservice.models.MeshUpgradeProfileProperties": null, - "azure.mgmt.containerservice.models.NamespaceProperties": null, - "azure.mgmt.containerservice.models.NetworkPolicies": null, - "azure.mgmt.containerservice.models.NetworkProfileForSnapshot": null, - "azure.mgmt.containerservice.models.NodeCustomizationProfile": null, - "azure.mgmt.containerservice.models.NodeImageVersion": null, - "azure.mgmt.containerservice.models.NodeImageVersionsListResult": null, - "azure.mgmt.containerservice.models.OperationListResult": null, - "azure.mgmt.containerservice.models.OperationStatusResult": null, - "azure.mgmt.containerservice.models.OperationStatusResultList": null, - "azure.mgmt.containerservice.models.OperationValue": null, - "azure.mgmt.containerservice.models.OutboundEnvironmentEndpoint": null, - "azure.mgmt.containerservice.models.OutboundEnvironmentEndpointCollection": null, - "azure.mgmt.containerservice.models.PortRange": null, - "azure.mgmt.containerservice.models.PowerState": null, - "azure.mgmt.containerservice.models.PrivateEndpoint": null, - "azure.mgmt.containerservice.models.PrivateEndpointConnection": null, - "azure.mgmt.containerservice.models.PrivateEndpointConnectionListResult": null, - "azure.mgmt.containerservice.models.PrivateLinkResource": null, - "azure.mgmt.containerservice.models.PrivateLinkResourcesListResult": null, - "azure.mgmt.containerservice.models.PrivateLinkServiceConnectionState": null, - "azure.mgmt.containerservice.models.RebalanceLoadBalancersRequestBody": null, - "azure.mgmt.containerservice.models.RelativeMonthlySchedule": null, - "azure.mgmt.containerservice.models.ResourceQuota": null, - "azure.mgmt.containerservice.models.ResourceReference": null, - "azure.mgmt.containerservice.models.RunCommandRequest": null, - "azure.mgmt.containerservice.models.RunCommandResult": null, - "azure.mgmt.containerservice.models.SafeguardsAvailableVersion": null, - "azure.mgmt.containerservice.models.SafeguardsAvailableVersionsList": null, - "azure.mgmt.containerservice.models.SafeguardsAvailableVersionsProperties": null, - "azure.mgmt.containerservice.models.ScaleProfile": null, - "azure.mgmt.containerservice.models.Schedule": null, - "azure.mgmt.containerservice.models.SchedulerInstanceProfile": null, - "azure.mgmt.containerservice.models.SchedulerProfile": null, - "azure.mgmt.containerservice.models.SchedulerProfileSchedulerInstanceProfiles": null, - "azure.mgmt.containerservice.models.ServiceMeshProfile": null, - "azure.mgmt.containerservice.models.Snapshot": null, - "azure.mgmt.containerservice.models.SnapshotListResult": null, - "azure.mgmt.containerservice.models.SysctlConfig": null, - "azure.mgmt.containerservice.models.SystemData": null, - "azure.mgmt.containerservice.models.TagsObject": null, - "azure.mgmt.containerservice.models.TimeInWeek": null, - "azure.mgmt.containerservice.models.TimeSpan": null, - "azure.mgmt.containerservice.models.TrustedAccessRole": null, - "azure.mgmt.containerservice.models.TrustedAccessRoleBinding": null, - "azure.mgmt.containerservice.models.TrustedAccessRoleBindingListResult": null, - "azure.mgmt.containerservice.models.TrustedAccessRoleListResult": null, - "azure.mgmt.containerservice.models.TrustedAccessRoleRule": null, - "azure.mgmt.containerservice.models.UpgradeOverrideSettings": null, - "azure.mgmt.containerservice.models.VirtualMachineNodes": null, - "azure.mgmt.containerservice.models.VirtualMachinesProfile": null, - "azure.mgmt.containerservice.models.WeeklySchedule": null, - "azure.mgmt.containerservice.models.WindowsGmsaProfile": null, - "azure.mgmt.containerservice.models.KubernetesSupportPlan": null, - "azure.mgmt.containerservice.models.Protocol": null, - "azure.mgmt.containerservice.models.OSDiskType": null, - "azure.mgmt.containerservice.models.KubeletDiskType": null, - "azure.mgmt.containerservice.models.WorkloadRuntime": null, - "azure.mgmt.containerservice.models.PodIPAllocationMode": null, - "azure.mgmt.containerservice.models.OSType": null, - "azure.mgmt.containerservice.models.OSSKU": null, - "azure.mgmt.containerservice.models.ScaleDownMode": null, - "azure.mgmt.containerservice.models.AgentPoolType": null, - "azure.mgmt.containerservice.models.AgentPoolMode": null, - "azure.mgmt.containerservice.models.UpgradeStrategy": null, - "azure.mgmt.containerservice.models.UndrainableNodeBehavior": null, - "azure.mgmt.containerservice.models.Code": null, - "azure.mgmt.containerservice.models.ScaleSetPriority": null, - "azure.mgmt.containerservice.models.ScaleSetEvictionPolicy": null, - "azure.mgmt.containerservice.models.SeccompDefault": null, - "azure.mgmt.containerservice.models.GPUInstanceProfile": null, - "azure.mgmt.containerservice.models.AgentPoolSSHAccess": null, - "azure.mgmt.containerservice.models.GPUDriver": null, - "azure.mgmt.containerservice.models.DriverType": null, - "azure.mgmt.containerservice.models.LocalDNSMode": null, - "azure.mgmt.containerservice.models.LocalDNSState": null, - "azure.mgmt.containerservice.models.LocalDNSQueryLogging": null, - "azure.mgmt.containerservice.models.LocalDNSProtocol": null, - "azure.mgmt.containerservice.models.LocalDNSForwardDestination": null, - "azure.mgmt.containerservice.models.LocalDNSForwardPolicy": null, - "azure.mgmt.containerservice.models.LocalDNSServeStale": null, - "azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningState": null, - "azure.mgmt.containerservice.models.IPFamily": null, - "azure.mgmt.containerservice.models.IstioIngressGatewayMode": null, - "azure.mgmt.containerservice.models.CreatedByType": null, - "azure.mgmt.containerservice.models.ManagedClusterSKUName": null, - "azure.mgmt.containerservice.models.ManagedClusterSKUTier": null, - "azure.mgmt.containerservice.models.ExtendedLocationTypes": null, - "azure.mgmt.containerservice.models.ResourceIdentityType": null, - "azure.mgmt.containerservice.models.LicenseType": null, - "azure.mgmt.containerservice.models.RestrictionLevel": null, - "azure.mgmt.containerservice.models.NetworkPlugin": null, - "azure.mgmt.containerservice.models.NetworkPluginMode": null, - "azure.mgmt.containerservice.models.NetworkPolicy": null, - "azure.mgmt.containerservice.models.NetworkMode": null, - "azure.mgmt.containerservice.models.NetworkDataplane": null, - "azure.mgmt.containerservice.models.OutboundType": null, - "azure.mgmt.containerservice.models.LoadBalancerSku": null, - "azure.mgmt.containerservice.models.BackendPoolType": null, - "azure.mgmt.containerservice.models.ClusterServiceLoadBalancerHealthProbeMode": null, - "azure.mgmt.containerservice.models.PodLinkLocalAccess": null, - "azure.mgmt.containerservice.models.Mode": null, - "azure.mgmt.containerservice.models.IpvsScheduler": null, - "azure.mgmt.containerservice.models.AdvancedNetworkPolicies": null, - "azure.mgmt.containerservice.models.TransitEncryptionType": null, - "azure.mgmt.containerservice.models.AccelerationMode": null, - "azure.mgmt.containerservice.models.UpgradeChannel": null, - "azure.mgmt.containerservice.models.NodeOSUpgradeChannel": null, - "azure.mgmt.containerservice.models.Expander": null, - "azure.mgmt.containerservice.models.KeyVaultNetworkAccessTypes": null, - "azure.mgmt.containerservice.models.InfrastructureEncryption": null, - "azure.mgmt.containerservice.models.ManagedGatewayType": null, - "azure.mgmt.containerservice.models.NginxIngressControllerType": null, - "azure.mgmt.containerservice.models.PublicNetworkAccess": null, - "azure.mgmt.containerservice.models.AddonAutoscaling": null, - "azure.mgmt.containerservice.models.ServiceMeshMode": null, - "azure.mgmt.containerservice.models.ProxyRedirectionMechanism": null, - "azure.mgmt.containerservice.models.NodeProvisioningMode": null, - "azure.mgmt.containerservice.models.NodeProvisioningDefaultNodePools": null, - "azure.mgmt.containerservice.models.ArtifactSource": null, - "azure.mgmt.containerservice.models.SchedulerConfigMode": null, - "azure.mgmt.containerservice.models.WeekDay": null, - "azure.mgmt.containerservice.models.Type": null, - "azure.mgmt.containerservice.models.NamespaceProvisioningState": null, - "azure.mgmt.containerservice.models.PolicyRule": null, - "azure.mgmt.containerservice.models.AdoptionPolicy": null, - "azure.mgmt.containerservice.models.DeletePolicy": null, - "azure.mgmt.containerservice.models.DriftAction": null, - "azure.mgmt.containerservice.models.VmState": null, - "azure.mgmt.containerservice.models.PrivateEndpointConnectionProvisioningState": null, - "azure.mgmt.containerservice.models.ConnectionStatus": null, - "azure.mgmt.containerservice.models.SnapshotType": null, - "azure.mgmt.containerservice.models.TrustedAccessRoleBindingProvisioningState": null, - "azure.mgmt.containerservice.models.GuardrailsSupport": null, - "azure.mgmt.containerservice.models.SafeguardsSupport": null, - "azure.mgmt.containerservice.models.Operator": null, - "azure.mgmt.containerservice.models.IdentityBindingProvisioningState": null, - "azure.mgmt.containerservice.models.JWTAuthenticatorProvisioningState": null, - "azure.mgmt.containerservice.models.MeshMembershipProvisioningState": null, - "azure.mgmt.containerservice.models.Format": null, - "azure.mgmt.containerservice.operations.Operations.list": null, - "azure.mgmt.containerservice.aio.operations.Operations.list": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_kubernetes_versions": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_kubernetes_versions": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_by_resource_group": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_by_resource_group": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_upgrade_profile": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_upgrade_profile": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_access_profile": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_access_profile": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_cluster_admin_credentials": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_cluster_admin_credentials": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_cluster_user_credentials": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_cluster_user_credentials": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_cluster_monitoring_user_credentials": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_cluster_monitoring_user_credentials": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.get": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_update_tags": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_update_tags": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_delete": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_delete": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_reset_service_principal_profile": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_reset_service_principal_profile": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_reset_aad_profile": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_reset_aad_profile": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_abort_latest_operation": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_abort_latest_operation": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_rotate_cluster_certificates": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_rotate_cluster_certificates": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_rotate_service_account_signing_keys": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_rotate_service_account_signing_keys": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_stop": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_stop": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_start": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_start": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_run_command": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_run_command": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_command_result": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_command_result": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_outbound_network_dependencies_endpoints": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_outbound_network_dependencies_endpoints": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_guardrails_versions": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_guardrails_versions": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_guardrails_versions": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_guardrails_versions": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_safeguards_versions": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_safeguards_versions": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_safeguards_versions": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_safeguards_versions": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_mesh_revision_profiles": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_mesh_revision_profiles": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_mesh_revision_profile": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_mesh_revision_profile": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_mesh_upgrade_profiles": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_mesh_upgrade_profiles": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_mesh_upgrade_profile": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_mesh_upgrade_profile": null, - "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_rebalance_load_balancers": null, - "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_rebalance_load_balancers": null, - "azure.mgmt.containerservice.operations.ContainerServiceOperations.list_node_image_versions": null, - "azure.mgmt.containerservice.aio.operations.ContainerServiceOperations.list_node_image_versions": null, - "azure.mgmt.containerservice.operations.MaintenanceConfigurationsOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.aio.operations.MaintenanceConfigurationsOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.operations.MaintenanceConfigurationsOperations.get": null, - "azure.mgmt.containerservice.aio.operations.MaintenanceConfigurationsOperations.get": null, - "azure.mgmt.containerservice.operations.MaintenanceConfigurationsOperations.create_or_update": null, - "azure.mgmt.containerservice.aio.operations.MaintenanceConfigurationsOperations.create_or_update": null, - "azure.mgmt.containerservice.operations.MaintenanceConfigurationsOperations.delete": null, - "azure.mgmt.containerservice.aio.operations.MaintenanceConfigurationsOperations.delete": null, - "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.get": null, - "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.get": null, - "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.begin_delete": null, - "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.begin_delete": null, - "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.update": null, - "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.update": null, - "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.list_credential": null, - "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.list_credential": null, - "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_abort_latest_operation": null, - "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_abort_latest_operation": null, - "azure.mgmt.containerservice.operations.AgentPoolsOperations.list": null, - "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.list": null, - "azure.mgmt.containerservice.operations.AgentPoolsOperations.get": null, - "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.get": null, - "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_delete": null, - "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_delete": null, - "azure.mgmt.containerservice.operations.AgentPoolsOperations.get_upgrade_profile": null, - "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.get_upgrade_profile": null, - "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_complete_upgrade": null, - "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_complete_upgrade": null, - "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_delete_machines": null, - "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_delete_machines": null, - "azure.mgmt.containerservice.operations.AgentPoolsOperations.get_available_agent_pool_versions": null, - "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.get_available_agent_pool_versions": null, - "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_upgrade_node_image_version": null, - "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_upgrade_node_image_version": null, - "azure.mgmt.containerservice.operations.MachinesOperations.list": null, - "azure.mgmt.containerservice.aio.operations.MachinesOperations.list": null, - "azure.mgmt.containerservice.operations.MachinesOperations.get": null, - "azure.mgmt.containerservice.aio.operations.MachinesOperations.get": null, - "azure.mgmt.containerservice.operations.MachinesOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.aio.operations.MachinesOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.operations.PrivateEndpointConnectionsOperations.list": null, - "azure.mgmt.containerservice.aio.operations.PrivateEndpointConnectionsOperations.list": null, - "azure.mgmt.containerservice.operations.PrivateEndpointConnectionsOperations.get": null, - "azure.mgmt.containerservice.aio.operations.PrivateEndpointConnectionsOperations.get": null, - "azure.mgmt.containerservice.operations.PrivateEndpointConnectionsOperations.update": null, - "azure.mgmt.containerservice.aio.operations.PrivateEndpointConnectionsOperations.update": null, - "azure.mgmt.containerservice.operations.PrivateEndpointConnectionsOperations.begin_delete": null, - "azure.mgmt.containerservice.aio.operations.PrivateEndpointConnectionsOperations.begin_delete": null, - "azure.mgmt.containerservice.operations.PrivateLinkResourcesOperations.list": null, - "azure.mgmt.containerservice.aio.operations.PrivateLinkResourcesOperations.list": null, - "azure.mgmt.containerservice.operations.ResolvePrivateLinkServiceIdOperations.post": null, - "azure.mgmt.containerservice.aio.operations.ResolvePrivateLinkServiceIdOperations.post": null, - "azure.mgmt.containerservice.operations.OperationStatusResultOperations.list": null, - "azure.mgmt.containerservice.aio.operations.OperationStatusResultOperations.list": null, - "azure.mgmt.containerservice.operations.OperationStatusResultOperations.get": null, - "azure.mgmt.containerservice.aio.operations.OperationStatusResultOperations.get": null, - "azure.mgmt.containerservice.operations.OperationStatusResultOperations.get_by_agent_pool": null, - "azure.mgmt.containerservice.aio.operations.OperationStatusResultOperations.get_by_agent_pool": null, - "azure.mgmt.containerservice.operations.SnapshotsOperations.list": null, - "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.list": null, - "azure.mgmt.containerservice.operations.SnapshotsOperations.list_by_resource_group": null, - "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.list_by_resource_group": null, - "azure.mgmt.containerservice.operations.SnapshotsOperations.get": null, - "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.get": null, - "azure.mgmt.containerservice.operations.SnapshotsOperations.create_or_update": null, - "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.create_or_update": null, - "azure.mgmt.containerservice.operations.SnapshotsOperations.update_tags": null, - "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.update_tags": null, - "azure.mgmt.containerservice.operations.SnapshotsOperations.delete": null, - "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.delete": null, - "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.list": null, - "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.list": null, - "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.list_by_resource_group": null, - "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.list_by_resource_group": null, - "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.get": null, - "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.get": null, - "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.create_or_update": null, - "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.create_or_update": null, - "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.update_tags": null, - "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.update_tags": null, - "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.delete": null, - "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.delete": null, - "azure.mgmt.containerservice.operations.TrustedAccessRolesOperations.list": null, - "azure.mgmt.containerservice.aio.operations.TrustedAccessRolesOperations.list": null, - "azure.mgmt.containerservice.operations.TrustedAccessRoleBindingsOperations.list": null, - "azure.mgmt.containerservice.aio.operations.TrustedAccessRoleBindingsOperations.list": null, - "azure.mgmt.containerservice.operations.TrustedAccessRoleBindingsOperations.get": null, - "azure.mgmt.containerservice.aio.operations.TrustedAccessRoleBindingsOperations.get": null, - "azure.mgmt.containerservice.operations.TrustedAccessRoleBindingsOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.aio.operations.TrustedAccessRoleBindingsOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.operations.TrustedAccessRoleBindingsOperations.begin_delete": null, - "azure.mgmt.containerservice.aio.operations.TrustedAccessRoleBindingsOperations.begin_delete": null, - "azure.mgmt.containerservice.operations.LoadBalancersOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.aio.operations.LoadBalancersOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.operations.LoadBalancersOperations.get": null, - "azure.mgmt.containerservice.aio.operations.LoadBalancersOperations.get": null, - "azure.mgmt.containerservice.operations.LoadBalancersOperations.create_or_update": null, - "azure.mgmt.containerservice.aio.operations.LoadBalancersOperations.create_or_update": null, - "azure.mgmt.containerservice.operations.LoadBalancersOperations.begin_delete": null, - "azure.mgmt.containerservice.aio.operations.LoadBalancersOperations.begin_delete": null, - "azure.mgmt.containerservice.operations.IdentityBindingsOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.aio.operations.IdentityBindingsOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.operations.IdentityBindingsOperations.get": null, - "azure.mgmt.containerservice.aio.operations.IdentityBindingsOperations.get": null, - "azure.mgmt.containerservice.operations.IdentityBindingsOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.aio.operations.IdentityBindingsOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.operations.IdentityBindingsOperations.begin_delete": null, - "azure.mgmt.containerservice.aio.operations.IdentityBindingsOperations.begin_delete": null, - "azure.mgmt.containerservice.operations.JWTAuthenticatorsOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.aio.operations.JWTAuthenticatorsOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.operations.JWTAuthenticatorsOperations.get": null, - "azure.mgmt.containerservice.aio.operations.JWTAuthenticatorsOperations.get": null, - "azure.mgmt.containerservice.operations.JWTAuthenticatorsOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.aio.operations.JWTAuthenticatorsOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.operations.JWTAuthenticatorsOperations.begin_delete": null, - "azure.mgmt.containerservice.aio.operations.JWTAuthenticatorsOperations.begin_delete": null, - "azure.mgmt.containerservice.operations.MeshMembershipsOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.aio.operations.MeshMembershipsOperations.list_by_managed_cluster": null, - "azure.mgmt.containerservice.operations.MeshMembershipsOperations.get": null, - "azure.mgmt.containerservice.aio.operations.MeshMembershipsOperations.get": null, - "azure.mgmt.containerservice.operations.MeshMembershipsOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.aio.operations.MeshMembershipsOperations.begin_create_or_update": null, - "azure.mgmt.containerservice.operations.MeshMembershipsOperations.begin_delete": null, - "azure.mgmt.containerservice.aio.operations.MeshMembershipsOperations.begin_delete": null + "azure.mgmt.containerservice.models.AbsoluteMonthlySchedule": "Microsoft.ContainerService.AbsoluteMonthlySchedule", + "azure.mgmt.containerservice.models.AccessProfile": "Microsoft.ContainerService.AccessProfile", + "azure.mgmt.containerservice.models.AdvancedNetworking": "Microsoft.ContainerService.AdvancedNetworking", + "azure.mgmt.containerservice.models.AdvancedNetworkingObservability": "Microsoft.ContainerService.AdvancedNetworkingObservability", + "azure.mgmt.containerservice.models.AdvancedNetworkingPerformance": "Microsoft.ContainerService.AdvancedNetworkingPerformance", + "azure.mgmt.containerservice.models.AdvancedNetworkingSecurity": "Microsoft.ContainerService.AdvancedNetworkingSecurity", + "azure.mgmt.containerservice.models.AdvancedNetworkingSecurityTransitEncryption": "Microsoft.ContainerService.AdvancedNetworkingSecurityTransitEncryption", + "azure.mgmt.containerservice.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.containerservice.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.containerservice.models.AgentPool": "Microsoft.ContainerService.AgentPool", + "azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile": "Microsoft.ContainerService.AgentPoolArtifactStreamingProfile", + "azure.mgmt.containerservice.models.AgentPoolAvailableVersions": "Microsoft.ContainerService.AgentPoolAvailableVersions", + "azure.mgmt.containerservice.models.AgentPoolAvailableVersionsProperties": "Microsoft.ContainerService.AgentPoolAvailableVersionsProperties", + "azure.mgmt.containerservice.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem": "Microsoft.ContainerService.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem", + "azure.mgmt.containerservice.models.AgentPoolBlueGreenUpgradeSettings": "Microsoft.ContainerService.AgentPoolBlueGreenUpgradeSettings", + "azure.mgmt.containerservice.models.AgentPoolDeleteMachinesParameter": "Microsoft.ContainerService.AgentPoolDeleteMachinesParameter", + "azure.mgmt.containerservice.models.AgentPoolGatewayProfile": "Microsoft.ContainerService.AgentPoolGatewayProfile", + "azure.mgmt.containerservice.models.AgentPoolNetworkProfile": "Microsoft.ContainerService.AgentPoolNetworkProfile", + "azure.mgmt.containerservice.models.AgentPoolRecentlyUsedVersion": "Microsoft.ContainerService.AgentPoolRecentlyUsedVersion", + "azure.mgmt.containerservice.models.AgentPoolSecurityProfile": "Microsoft.ContainerService.AgentPoolSecurityProfile", + "azure.mgmt.containerservice.models.AgentPoolStatus": "Microsoft.ContainerService.AgentPoolStatus", + "azure.mgmt.containerservice.models.AgentPoolUpgradeProfile": "Microsoft.ContainerService.AgentPoolUpgradeProfile", + "azure.mgmt.containerservice.models.AgentPoolUpgradeProfileProperties": "Microsoft.ContainerService.AgentPoolUpgradeProfileProperties", + "azure.mgmt.containerservice.models.AgentPoolUpgradeProfilePropertiesUpgradesItem": "Microsoft.ContainerService.AgentPoolUpgradeProfilePropertiesUpgradesItem", + "azure.mgmt.containerservice.models.AgentPoolUpgradeSettings": "Microsoft.ContainerService.AgentPoolUpgradeSettings", + "azure.mgmt.containerservice.models.AgentPoolWindowsProfile": "Microsoft.ContainerService.AgentPoolWindowsProfile", + "azure.mgmt.containerservice.models.AutoScaleProfile": "Microsoft.ContainerService.AutoScaleProfile", + "azure.mgmt.containerservice.models.AzureKeyVaultKms": "Microsoft.ContainerService.AzureKeyVaultKms", + "azure.mgmt.containerservice.models.ClusterUpgradeSettings": "Microsoft.ContainerService.ClusterUpgradeSettings", + "azure.mgmt.containerservice.models.CommandResultProperties": "Microsoft.ContainerService.CommandResultProperties", + "azure.mgmt.containerservice.models.CompatibleVersions": "Microsoft.ContainerService.CompatibleVersions", + "azure.mgmt.containerservice.models.Component": "Microsoft.ContainerService.Component", + "azure.mgmt.containerservice.models.ComponentsByRelease": "Microsoft.ContainerService.ComponentsByRelease", + "azure.mgmt.containerservice.models.ContainerServiceLinuxProfile": "Microsoft.ContainerService.ContainerServiceLinuxProfile", + "azure.mgmt.containerservice.models.ContainerServiceNetworkProfile": "Microsoft.ContainerService.ContainerServiceNetworkProfile", + "azure.mgmt.containerservice.models.ContainerServiceNetworkProfileKubeProxyConfig": "Microsoft.ContainerService.ContainerServiceNetworkProfileKubeProxyConfig", + "azure.mgmt.containerservice.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig": "Microsoft.ContainerService.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig", + "azure.mgmt.containerservice.models.ContainerServiceSshConfiguration": "Microsoft.ContainerService.ContainerServiceSshConfiguration", + "azure.mgmt.containerservice.models.ContainerServiceSshPublicKey": "Microsoft.ContainerService.ContainerServiceSshPublicKey", + "azure.mgmt.containerservice.models.CreationData": "Microsoft.ContainerService.CreationData", + "azure.mgmt.containerservice.models.CredentialResult": "Microsoft.ContainerService.CredentialResult", + "azure.mgmt.containerservice.models.CredentialResults": "Microsoft.ContainerService.CredentialResults", + "azure.mgmt.containerservice.models.DailySchedule": "Microsoft.ContainerService.DailySchedule", + "azure.mgmt.containerservice.models.DateSpan": "Microsoft.ContainerService.DateSpan", + "azure.mgmt.containerservice.models.DelegatedResource": "Azure.ResourceManager.CommonTypes.DelegatedResource", + "azure.mgmt.containerservice.models.EndpointDependency": "Microsoft.ContainerService.EndpointDependency", + "azure.mgmt.containerservice.models.EndpointDetail": "Microsoft.ContainerService.EndpointDetail", + "azure.mgmt.containerservice.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.containerservice.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.containerservice.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.containerservice.models.ExtendedLocation": "Microsoft.ContainerService.ExtendedLocation", + "azure.mgmt.containerservice.models.GPUProfile": "Microsoft.ContainerService.GPUProfile", + "azure.mgmt.containerservice.models.GuardrailsAvailableVersion": "Microsoft.ContainerService.GuardrailsAvailableVersion", + "azure.mgmt.containerservice.models.GuardrailsAvailableVersionsProperties": "Microsoft.ContainerService.GuardrailsAvailableVersionsProperties", + "azure.mgmt.containerservice.models.IdentityBinding": "Microsoft.ContainerService.IdentityBinding", + "azure.mgmt.containerservice.models.IdentityBindingManagedIdentityProfile": "Microsoft.ContainerService.IdentityBindingManagedIdentityProfile", + "azure.mgmt.containerservice.models.IdentityBindingOidcIssuerProfile": "Microsoft.ContainerService.IdentityBindingOidcIssuerProfile", + "azure.mgmt.containerservice.models.IdentityBindingProperties": "Microsoft.ContainerService.IdentityBindingProperties", + "azure.mgmt.containerservice.models.IPTag": "Microsoft.ContainerService.IPTag", + "azure.mgmt.containerservice.models.IstioCertificateAuthority": "Microsoft.ContainerService.IstioCertificateAuthority", + "azure.mgmt.containerservice.models.IstioComponents": "Microsoft.ContainerService.IstioComponents", + "azure.mgmt.containerservice.models.IstioEgressGateway": "Microsoft.ContainerService.IstioEgressGateway", + "azure.mgmt.containerservice.models.IstioIngressGateway": "Microsoft.ContainerService.IstioIngressGateway", + "azure.mgmt.containerservice.models.IstioPluginCertificateAuthority": "Microsoft.ContainerService.IstioPluginCertificateAuthority", + "azure.mgmt.containerservice.models.IstioServiceMesh": "Microsoft.ContainerService.IstioServiceMesh", + "azure.mgmt.containerservice.models.JWTAuthenticator": "Microsoft.ContainerService.JWTAuthenticator", + "azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression": "Microsoft.ContainerService.JWTAuthenticatorClaimMappingExpression", + "azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappings": "Microsoft.ContainerService.JWTAuthenticatorClaimMappings", + "azure.mgmt.containerservice.models.JWTAuthenticatorExtraClaimMappingExpression": "Microsoft.ContainerService.JWTAuthenticatorExtraClaimMappingExpression", + "azure.mgmt.containerservice.models.JWTAuthenticatorIssuer": "Microsoft.ContainerService.JWTAuthenticatorIssuer", + "azure.mgmt.containerservice.models.JWTAuthenticatorProperties": "Microsoft.ContainerService.JWTAuthenticatorProperties", + "azure.mgmt.containerservice.models.JWTAuthenticatorValidationRule": "Microsoft.ContainerService.JWTAuthenticatorValidationRule", + "azure.mgmt.containerservice.models.KubeletConfig": "Microsoft.ContainerService.KubeletConfig", + "azure.mgmt.containerservice.models.KubernetesPatchVersion": "Microsoft.ContainerService.KubernetesPatchVersion", + "azure.mgmt.containerservice.models.KubernetesResourceObjectEncryptionProfile": "Microsoft.ContainerService.KubernetesResourceObjectEncryptionProfile", + "azure.mgmt.containerservice.models.KubernetesVersion": "Microsoft.ContainerService.KubernetesVersion", + "azure.mgmt.containerservice.models.KubernetesVersionCapabilities": "Microsoft.ContainerService.KubernetesVersionCapabilities", + "azure.mgmt.containerservice.models.KubernetesVersionListResult": "Microsoft.ContainerService.KubernetesVersionListResult", + "azure.mgmt.containerservice.models.LabelSelector": "Microsoft.ContainerService.LabelSelector", + "azure.mgmt.containerservice.models.LabelSelectorRequirement": "Microsoft.ContainerService.LabelSelectorRequirement", + "azure.mgmt.containerservice.models.LinuxOSConfig": "Microsoft.ContainerService.LinuxOSConfig", + "azure.mgmt.containerservice.models.LoadBalancer": "Microsoft.ContainerService.LoadBalancer", + "azure.mgmt.containerservice.models.LoadBalancerProperties": "Microsoft.ContainerService.LoadBalancerProperties", + "azure.mgmt.containerservice.models.LocalDNSOverride": "Microsoft.ContainerService.LocalDNSOverride", + "azure.mgmt.containerservice.models.LocalDNSProfile": "Microsoft.ContainerService.LocalDNSProfile", + "azure.mgmt.containerservice.models.Machine": "Microsoft.ContainerService.Machine", + "azure.mgmt.containerservice.models.MachineHardwareProfile": "Microsoft.ContainerService.MachineHardwareProfile", + "azure.mgmt.containerservice.models.MachineIpAddress": "Microsoft.ContainerService.MachineIpAddress", + "azure.mgmt.containerservice.models.MachineKubernetesProfile": "Microsoft.ContainerService.MachineKubernetesProfile", + "azure.mgmt.containerservice.models.MachineNetworkProperties": "Microsoft.ContainerService.MachineNetworkProperties", + "azure.mgmt.containerservice.models.MachineOSProfile": "Microsoft.ContainerService.MachineOSProfile", + "azure.mgmt.containerservice.models.MachineOSProfileLinuxProfile": "Microsoft.ContainerService.MachineOSProfileLinuxProfile", + "azure.mgmt.containerservice.models.MachineProperties": "Microsoft.ContainerService.MachineProperties", + "azure.mgmt.containerservice.models.MachineSecurityProfile": "Microsoft.ContainerService.MachineSecurityProfile", + "azure.mgmt.containerservice.models.MachineStatus": "Microsoft.ContainerService.MachineStatus", + "azure.mgmt.containerservice.models.MaintenanceConfiguration": "Microsoft.ContainerService.MaintenanceConfiguration", + "azure.mgmt.containerservice.models.MaintenanceConfigurationProperties": "Microsoft.ContainerService.MaintenanceConfigurationProperties", + "azure.mgmt.containerservice.models.MaintenanceWindow": "Microsoft.ContainerService.MaintenanceWindow", + "azure.mgmt.containerservice.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.containerservice.models.ManagedCluster": "Microsoft.ContainerService.ManagedCluster", + "azure.mgmt.containerservice.models.ManagedClusterAADProfile": "Microsoft.ContainerService.ManagedClusterAADProfile", + "azure.mgmt.containerservice.models.ManagedClusterAccessProfile": "Microsoft.ContainerService.ManagedClusterAccessProfile", + "azure.mgmt.containerservice.models.ManagedClusterAddonProfile": "Microsoft.ContainerService.ManagedClusterAddonProfile", + "azure.mgmt.containerservice.models.UserAssignedIdentity": "Microsoft.ContainerService.UserAssignedIdentity", + "azure.mgmt.containerservice.models.ManagedClusterAddonProfileIdentity": "Microsoft.ContainerService.ManagedClusterAddonProfileIdentity", + "azure.mgmt.containerservice.models.ManagedClusterAgentPoolProfileProperties": "Microsoft.ContainerService.ManagedClusterAgentPoolProfileProperties", + "azure.mgmt.containerservice.models.ManagedClusterAgentPoolProfile": "Microsoft.ContainerService.ManagedClusterAgentPoolProfile", + "azure.mgmt.containerservice.models.ManagedClusterAIToolchainOperatorProfile": "Microsoft.ContainerService.ManagedClusterAIToolchainOperatorProfile", + "azure.mgmt.containerservice.models.ManagedClusterAPIServerAccessProfile": "Microsoft.ContainerService.ManagedClusterAPIServerAccessProfile", + "azure.mgmt.containerservice.models.ManagedClusterAutoUpgradeProfile": "Microsoft.ContainerService.ManagedClusterAutoUpgradeProfile", + "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfile": "Microsoft.ContainerService.ManagedClusterAzureMonitorProfile", + "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoring": "Microsoft.ContainerService.ManagedClusterAzureMonitorProfileAppMonitoring", + "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation": "Microsoft.ContainerService.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation", + "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs": "Microsoft.ContainerService.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs", + "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics": "Microsoft.ContainerService.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics", + "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileContainerInsights": "Microsoft.ContainerService.ManagedClusterAzureMonitorProfileContainerInsights", + "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileKubeStateMetrics": "Microsoft.ContainerService.ManagedClusterAzureMonitorProfileKubeStateMetrics", + "azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileMetrics": "Microsoft.ContainerService.ManagedClusterAzureMonitorProfileMetrics", + "azure.mgmt.containerservice.models.ManagedClusterBootstrapProfile": "Microsoft.ContainerService.ManagedClusterBootstrapProfile", + "azure.mgmt.containerservice.models.ManagedClusterCostAnalysis": "Microsoft.ContainerService.ManagedClusterCostAnalysis", + "azure.mgmt.containerservice.models.ManagedClusterHostedSystemProfile": "Microsoft.ContainerService.ManagedClusterHostedSystemProfile", + "azure.mgmt.containerservice.models.ManagedClusterHTTPProxyConfig": "Microsoft.ContainerService.ManagedClusterHTTPProxyConfig", + "azure.mgmt.containerservice.models.ManagedClusterIdentity": "Microsoft.ContainerService.ManagedClusterIdentity", + "azure.mgmt.containerservice.models.ManagedClusterIngressDefaultDomainProfile": "Microsoft.ContainerService.ManagedClusterIngressDefaultDomainProfile", + "azure.mgmt.containerservice.models.ManagedClusterIngressProfile": "Microsoft.ContainerService.ManagedClusterIngressProfile", + "azure.mgmt.containerservice.models.ManagedClusterIngressProfileApplicationLoadBalancer": "Microsoft.ContainerService.ManagedClusterIngressProfileApplicationLoadBalancer", + "azure.mgmt.containerservice.models.ManagedClusterIngressProfileGatewayConfiguration": "Microsoft.ContainerService.ManagedClusterIngressProfileGatewayConfiguration", + "azure.mgmt.containerservice.models.ManagedClusterIngressProfileNginx": "Microsoft.ContainerService.ManagedClusterIngressProfileNginx", + "azure.mgmt.containerservice.models.ManagedClusterIngressProfileWebAppRouting": "Microsoft.ContainerService.ManagedClusterIngressProfileWebAppRouting", + "azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfile": "Microsoft.ContainerService.ManagedClusterLoadBalancerProfile", + "azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs": "Microsoft.ContainerService.ManagedClusterLoadBalancerProfileManagedOutboundIPs", + "azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes": "Microsoft.ContainerService.ManagedClusterLoadBalancerProfileOutboundIPPrefixes", + "azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileOutboundIPs": "Microsoft.ContainerService.ManagedClusterLoadBalancerProfileOutboundIPs", + "azure.mgmt.containerservice.models.ManagedClusterManagedOutboundIPProfile": "Microsoft.ContainerService.ManagedClusterManagedOutboundIPProfile", + "azure.mgmt.containerservice.models.ManagedClusterMetricsProfile": "Microsoft.ContainerService.ManagedClusterMetricsProfile", + "azure.mgmt.containerservice.models.ManagedClusterNATGatewayProfile": "Microsoft.ContainerService.ManagedClusterNATGatewayProfile", + "azure.mgmt.containerservice.models.ManagedClusterNodeProvisioningProfile": "Microsoft.ContainerService.ManagedClusterNodeProvisioningProfile", + "azure.mgmt.containerservice.models.ManagedClusterNodeResourceGroupProfile": "Microsoft.ContainerService.ManagedClusterNodeResourceGroupProfile", + "azure.mgmt.containerservice.models.ManagedClusterOIDCIssuerProfile": "Microsoft.ContainerService.ManagedClusterOIDCIssuerProfile", + "azure.mgmt.containerservice.models.ManagedClusterPodIdentity": "Microsoft.ContainerService.ManagedClusterPodIdentity", + "azure.mgmt.containerservice.models.ManagedClusterPodIdentityException": "Microsoft.ContainerService.ManagedClusterPodIdentityException", + "azure.mgmt.containerservice.models.ManagedClusterPodIdentityProfile": "Microsoft.ContainerService.ManagedClusterPodIdentityProfile", + "azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningError": "Microsoft.ContainerService.ManagedClusterPodIdentityProvisioningError", + "azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningErrorBody": "Microsoft.ContainerService.ManagedClusterPodIdentityProvisioningErrorBody", + "azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningInfo": "Microsoft.ContainerService.ManagedClusterPodIdentityProvisioningInfo", + "azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfile": "Microsoft.ContainerService.ManagedClusterPoolUpgradeProfile", + "azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfileUpgradesItem": "Microsoft.ContainerService.ManagedClusterPoolUpgradeProfileUpgradesItem", + "azure.mgmt.containerservice.models.ManagedClusterProperties": "Microsoft.ContainerService.ManagedClusterProperties", + "azure.mgmt.containerservice.models.ManagedClusterPropertiesAutoScalerProfile": "Microsoft.ContainerService.ManagedClusterPropertiesAutoScalerProfile", + "azure.mgmt.containerservice.models.ManagedClusterPropertiesForSnapshot": "Microsoft.ContainerService.ManagedClusterPropertiesForSnapshot", + "azure.mgmt.containerservice.models.ManagedClusterSecurityProfile": "Microsoft.ContainerService.ManagedClusterSecurityProfile", + "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefender": "Microsoft.ContainerService.ManagedClusterSecurityProfileDefender", + "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityGating": "Microsoft.ContainerService.ManagedClusterSecurityProfileDefenderSecurityGating", + "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem": "Microsoft.ContainerService.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem", + "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring": "Microsoft.ContainerService.ManagedClusterSecurityProfileDefenderSecurityMonitoring", + "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileImageCleaner": "Microsoft.ContainerService.ManagedClusterSecurityProfileImageCleaner", + "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileImageIntegrity": "Microsoft.ContainerService.ManagedClusterSecurityProfileImageIntegrity", + "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileNodeRestriction": "Microsoft.ContainerService.ManagedClusterSecurityProfileNodeRestriction", + "azure.mgmt.containerservice.models.ManagedClusterSecurityProfileWorkloadIdentity": "Microsoft.ContainerService.ManagedClusterSecurityProfileWorkloadIdentity", + "azure.mgmt.containerservice.models.ManagedClusterServicePrincipalProfile": "Microsoft.ContainerService.ManagedClusterServicePrincipalProfile", + "azure.mgmt.containerservice.models.ManagedClusterSKU": "Microsoft.ContainerService.ManagedClusterSKU", + "azure.mgmt.containerservice.models.ManagedClusterSnapshot": "Microsoft.ContainerService.ManagedClusterSnapshot", + "azure.mgmt.containerservice.models.ManagedClusterSnapshotProperties": "Microsoft.ContainerService.ManagedClusterSnapshotProperties", + "azure.mgmt.containerservice.models.ManagedClusterStaticEgressGatewayProfile": "Microsoft.ContainerService.ManagedClusterStaticEgressGatewayProfile", + "azure.mgmt.containerservice.models.ManagedClusterStatus": "Microsoft.ContainerService.ManagedClusterStatus", + "azure.mgmt.containerservice.models.ManagedClusterStorageProfile": "Microsoft.ContainerService.ManagedClusterStorageProfile", + "azure.mgmt.containerservice.models.ManagedClusterStorageProfileBlobCSIDriver": "Microsoft.ContainerService.ManagedClusterStorageProfileBlobCSIDriver", + "azure.mgmt.containerservice.models.ManagedClusterStorageProfileDiskCSIDriver": "Microsoft.ContainerService.ManagedClusterStorageProfileDiskCSIDriver", + "azure.mgmt.containerservice.models.ManagedClusterStorageProfileFileCSIDriver": "Microsoft.ContainerService.ManagedClusterStorageProfileFileCSIDriver", + "azure.mgmt.containerservice.models.ManagedClusterStorageProfileSnapshotController": "Microsoft.ContainerService.ManagedClusterStorageProfileSnapshotController", + "azure.mgmt.containerservice.models.ManagedClusterUpgradeProfile": "Microsoft.ContainerService.ManagedClusterUpgradeProfile", + "azure.mgmt.containerservice.models.ManagedClusterUpgradeProfileProperties": "Microsoft.ContainerService.ManagedClusterUpgradeProfileProperties", + "azure.mgmt.containerservice.models.ManagedClusterWindowsProfile": "Microsoft.ContainerService.ManagedClusterWindowsProfile", + "azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfile": "Microsoft.ContainerService.ManagedClusterWorkloadAutoScalerProfile", + "azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfileKeda": "Microsoft.ContainerService.ManagedClusterWorkloadAutoScalerProfileKeda", + "azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler": "Microsoft.ContainerService.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", + "azure.mgmt.containerservice.models.ManagedNamespace": "Microsoft.ContainerService.ManagedNamespace", + "azure.mgmt.containerservice.models.ManagedServiceIdentityUserAssignedIdentitiesValue": "Microsoft.ContainerService.ManagedServiceIdentityUserAssignedIdentitiesValue", + "azure.mgmt.containerservice.models.ManualScaleProfile": "Microsoft.ContainerService.ManualScaleProfile", + "azure.mgmt.containerservice.models.MeshMembership": "Microsoft.ContainerService.MeshMembership", + "azure.mgmt.containerservice.models.MeshMembershipProperties": "Microsoft.ContainerService.MeshMembershipProperties", + "azure.mgmt.containerservice.models.MeshRevision": "Microsoft.ContainerService.MeshRevision", + "azure.mgmt.containerservice.models.MeshRevisionProfile": "Microsoft.ContainerService.MeshRevisionProfile", + "azure.mgmt.containerservice.models.MeshRevisionProfileProperties": "Microsoft.ContainerService.MeshRevisionProfileProperties", + "azure.mgmt.containerservice.models.MeshUpgradeProfile": "Microsoft.ContainerService.MeshUpgradeProfile", + "azure.mgmt.containerservice.models.MeshUpgradeProfileProperties": "Microsoft.ContainerService.MeshUpgradeProfileProperties", + "azure.mgmt.containerservice.models.NamespaceProperties": "Microsoft.ContainerService.NamespaceProperties", + "azure.mgmt.containerservice.models.NetworkPolicies": "Microsoft.ContainerService.NetworkPolicies", + "azure.mgmt.containerservice.models.NetworkProfileForSnapshot": "Microsoft.ContainerService.NetworkProfileForSnapshot", + "azure.mgmt.containerservice.models.NodeCustomizationProfile": "Microsoft.ContainerService.NodeCustomizationProfile", + "azure.mgmt.containerservice.models.NodeImageVersion": "Microsoft.ContainerService.NodeImageVersion", + "azure.mgmt.containerservice.models.OperationStatusResult": "Azure.ResourceManager.CommonTypes.OperationStatusResult", + "azure.mgmt.containerservice.models.OperationValue": "Microsoft.ContainerService.OperationValue", + "azure.mgmt.containerservice.models.OperationValueDisplay": "Microsoft.ContainerService.OperationValueDisplay", + "azure.mgmt.containerservice.models.OutboundEnvironmentEndpoint": "Microsoft.ContainerService.OutboundEnvironmentEndpoint", + "azure.mgmt.containerservice.models.PortRange": "Microsoft.ContainerService.PortRange", + "azure.mgmt.containerservice.models.PowerState": "Microsoft.ContainerService.PowerState", + "azure.mgmt.containerservice.models.PrivateEndpoint": "Microsoft.ContainerService.PrivateEndpoint", + "azure.mgmt.containerservice.models.PrivateEndpointConnection": "Microsoft.ContainerService.PrivateEndpointConnection", + "azure.mgmt.containerservice.models.PrivateEndpointConnectionListResult": "Microsoft.ContainerService.PrivateEndpointConnectionListResult", + "azure.mgmt.containerservice.models.PrivateEndpointConnectionProperties": "Microsoft.ContainerService.PrivateEndpointConnectionProperties", + "azure.mgmt.containerservice.models.PrivateLinkResource": "Microsoft.ContainerService.PrivateLinkResource", + "azure.mgmt.containerservice.models.PrivateLinkResourcesListResult": "Microsoft.ContainerService.PrivateLinkResourcesListResult", + "azure.mgmt.containerservice.models.PrivateLinkServiceConnectionState": "Microsoft.ContainerService.PrivateLinkServiceConnectionState", + "azure.mgmt.containerservice.models.RebalanceLoadBalancersRequestBody": "Microsoft.ContainerService.RebalanceLoadBalancersRequestBody", + "azure.mgmt.containerservice.models.RelativeMonthlySchedule": "Microsoft.ContainerService.RelativeMonthlySchedule", + "azure.mgmt.containerservice.models.ResourceQuota": "Microsoft.ContainerService.ResourceQuota", + "azure.mgmt.containerservice.models.ResourceReference": "Microsoft.ContainerService.ResourceReference", + "azure.mgmt.containerservice.models.RunCommandRequest": "Microsoft.ContainerService.RunCommandRequest", + "azure.mgmt.containerservice.models.RunCommandResult": "Microsoft.ContainerService.RunCommandResult", + "azure.mgmt.containerservice.models.SafeguardsAvailableVersion": "Microsoft.ContainerService.SafeguardsAvailableVersion", + "azure.mgmt.containerservice.models.SafeguardsAvailableVersionsProperties": "Microsoft.ContainerService.SafeguardsAvailableVersionsProperties", + "azure.mgmt.containerservice.models.ScaleProfile": "Microsoft.ContainerService.ScaleProfile", + "azure.mgmt.containerservice.models.Schedule": "Microsoft.ContainerService.Schedule", + "azure.mgmt.containerservice.models.SchedulerInstanceProfile": "Microsoft.ContainerService.SchedulerInstanceProfile", + "azure.mgmt.containerservice.models.SchedulerProfile": "Microsoft.ContainerService.SchedulerProfile", + "azure.mgmt.containerservice.models.SchedulerProfileSchedulerInstanceProfiles": "Microsoft.ContainerService.SchedulerProfileSchedulerInstanceProfiles", + "azure.mgmt.containerservice.models.ServiceMeshProfile": "Microsoft.ContainerService.ServiceMeshProfile", + "azure.mgmt.containerservice.models.Snapshot": "Microsoft.ContainerService.Snapshot", + "azure.mgmt.containerservice.models.SnapshotProperties": "Microsoft.ContainerService.SnapshotProperties", + "azure.mgmt.containerservice.models.SysctlConfig": "Microsoft.ContainerService.SysctlConfig", + "azure.mgmt.containerservice.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.containerservice.models.TagsObject": "Microsoft.ContainerService.TagsObject", + "azure.mgmt.containerservice.models.TimeInWeek": "Microsoft.ContainerService.TimeInWeek", + "azure.mgmt.containerservice.models.TimeSpan": "Microsoft.ContainerService.TimeSpan", + "azure.mgmt.containerservice.models.TrustedAccessRole": "Microsoft.ContainerService.TrustedAccessRole", + "azure.mgmt.containerservice.models.TrustedAccessRoleBinding": "Microsoft.ContainerService.TrustedAccessRoleBinding", + "azure.mgmt.containerservice.models.TrustedAccessRoleBindingProperties": "Microsoft.ContainerService.TrustedAccessRoleBindingProperties", + "azure.mgmt.containerservice.models.TrustedAccessRoleRule": "Microsoft.ContainerService.TrustedAccessRoleRule", + "azure.mgmt.containerservice.models.UpgradeOverrideSettings": "Microsoft.ContainerService.UpgradeOverrideSettings", + "azure.mgmt.containerservice.models.VirtualMachineNodes": "Microsoft.ContainerService.VirtualMachineNodes", + "azure.mgmt.containerservice.models.VirtualMachinesProfile": "Microsoft.ContainerService.VirtualMachinesProfile", + "azure.mgmt.containerservice.models.WeeklySchedule": "Microsoft.ContainerService.WeeklySchedule", + "azure.mgmt.containerservice.models.WindowsGmsaProfile": "Microsoft.ContainerService.WindowsGmsaProfile", + "azure.mgmt.containerservice.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", + "azure.mgmt.containerservice.models.OSDiskType": "Microsoft.ContainerService.OSDiskType", + "azure.mgmt.containerservice.models.KubeletDiskType": "Microsoft.ContainerService.KubeletDiskType", + "azure.mgmt.containerservice.models.WorkloadRuntime": "Microsoft.ContainerService.WorkloadRuntime", + "azure.mgmt.containerservice.models.PodIPAllocationMode": "Microsoft.ContainerService.PodIPAllocationMode", + "azure.mgmt.containerservice.models.OSType": "Microsoft.ContainerService.OSType", + "azure.mgmt.containerservice.models.OSSKU": "Microsoft.ContainerService.OSSKU", + "azure.mgmt.containerservice.models.ScaleDownMode": "Microsoft.ContainerService.ScaleDownMode", + "azure.mgmt.containerservice.models.AgentPoolType": "Microsoft.ContainerService.AgentPoolType", + "azure.mgmt.containerservice.models.AgentPoolMode": "Microsoft.ContainerService.AgentPoolMode", + "azure.mgmt.containerservice.models.UpgradeStrategy": "Microsoft.ContainerService.UpgradeStrategy", + "azure.mgmt.containerservice.models.UndrainableNodeBehavior": "Microsoft.ContainerService.UndrainableNodeBehavior", + "azure.mgmt.containerservice.models.Code": "Microsoft.ContainerService.Code", + "azure.mgmt.containerservice.models.ScaleSetPriority": "Microsoft.ContainerService.ScaleSetPriority", + "azure.mgmt.containerservice.models.ScaleSetEvictionPolicy": "Microsoft.ContainerService.ScaleSetEvictionPolicy", + "azure.mgmt.containerservice.models.SeccompDefault": "Microsoft.ContainerService.SeccompDefault", + "azure.mgmt.containerservice.models.GPUInstanceProfile": "Microsoft.ContainerService.GPUInstanceProfile", + "azure.mgmt.containerservice.models.Protocol": "Microsoft.ContainerService.Protocol", + "azure.mgmt.containerservice.models.AgentPoolSSHAccess": "Microsoft.ContainerService.AgentPoolSSHAccess", + "azure.mgmt.containerservice.models.GPUDriver": "Microsoft.ContainerService.GPUDriver", + "azure.mgmt.containerservice.models.DriverType": "Microsoft.ContainerService.DriverType", + "azure.mgmt.containerservice.models.LocalDNSMode": "Microsoft.ContainerService.LocalDNSMode", + "azure.mgmt.containerservice.models.LocalDNSState": "Microsoft.ContainerService.LocalDNSState", + "azure.mgmt.containerservice.models.LocalDNSQueryLogging": "Microsoft.ContainerService.LocalDNSQueryLogging", + "azure.mgmt.containerservice.models.LocalDNSProtocol": "Microsoft.ContainerService.LocalDNSProtocol", + "azure.mgmt.containerservice.models.LocalDNSForwardDestination": "Microsoft.ContainerService.LocalDNSForwardDestination", + "azure.mgmt.containerservice.models.LocalDNSForwardPolicy": "Microsoft.ContainerService.LocalDNSForwardPolicy", + "azure.mgmt.containerservice.models.LocalDNSServeStale": "Microsoft.ContainerService.LocalDNSServeStale", + "azure.mgmt.containerservice.models.LicenseType": "Microsoft.ContainerService.LicenseType", + "azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningState": "Microsoft.ContainerService.ManagedClusterPodIdentityProvisioningState", + "azure.mgmt.containerservice.models.RestrictionLevel": "Microsoft.ContainerService.RestrictionLevel", + "azure.mgmt.containerservice.models.KubernetesSupportPlan": "Microsoft.ContainerService.KubernetesSupportPlan", + "azure.mgmt.containerservice.models.NetworkPlugin": "Microsoft.ContainerService.NetworkPlugin", + "azure.mgmt.containerservice.models.NetworkPluginMode": "Microsoft.ContainerService.NetworkPluginMode", + "azure.mgmt.containerservice.models.NetworkPolicy": "Microsoft.ContainerService.NetworkPolicy", + "azure.mgmt.containerservice.models.NetworkMode": "Microsoft.ContainerService.NetworkMode", + "azure.mgmt.containerservice.models.NetworkDataplane": "Microsoft.ContainerService.NetworkDataplane", + "azure.mgmt.containerservice.models.AdvancedNetworkPolicies": "Microsoft.ContainerService.AdvancedNetworkPolicies", + "azure.mgmt.containerservice.models.TransitEncryptionType": "Microsoft.ContainerService.TransitEncryptionType", + "azure.mgmt.containerservice.models.AccelerationMode": "Microsoft.ContainerService.AccelerationMode", + "azure.mgmt.containerservice.models.OutboundType": "Microsoft.ContainerService.OutboundType", + "azure.mgmt.containerservice.models.LoadBalancerSku": "Microsoft.ContainerService.LoadBalancerSku", + "azure.mgmt.containerservice.models.BackendPoolType": "Microsoft.ContainerService.BackendPoolType", + "azure.mgmt.containerservice.models.ClusterServiceLoadBalancerHealthProbeMode": "Microsoft.ContainerService.ClusterServiceLoadBalancerHealthProbeMode", + "azure.mgmt.containerservice.models.IPFamily": "Microsoft.ContainerService.IPFamily", + "azure.mgmt.containerservice.models.PodLinkLocalAccess": "Microsoft.ContainerService.PodLinkLocalAccess", + "azure.mgmt.containerservice.models.Mode": "Microsoft.ContainerService.Mode", + "azure.mgmt.containerservice.models.IpvsScheduler": "Microsoft.ContainerService.IpvsScheduler", + "azure.mgmt.containerservice.models.UpgradeChannel": "Microsoft.ContainerService.UpgradeChannel", + "azure.mgmt.containerservice.models.NodeOSUpgradeChannel": "Microsoft.ContainerService.NodeOSUpgradeChannel", + "azure.mgmt.containerservice.models.Expander": "Microsoft.ContainerService.Expander", + "azure.mgmt.containerservice.models.KeyVaultNetworkAccessTypes": "Microsoft.ContainerService.KeyVaultNetworkAccessTypes", + "azure.mgmt.containerservice.models.InfrastructureEncryption": "Microsoft.ContainerService.InfrastructureEncryption", + "azure.mgmt.containerservice.models.NginxIngressControllerType": "Microsoft.ContainerService.NginxIngressControllerType", + "azure.mgmt.containerservice.models.ManagedGatewayType": "Microsoft.ContainerService.ManagedGatewayType", + "azure.mgmt.containerservice.models.PublicNetworkAccess": "Microsoft.ContainerService.PublicNetworkAccess", + "azure.mgmt.containerservice.models.AddonAutoscaling": "Microsoft.ContainerService.AddonAutoscaling", + "azure.mgmt.containerservice.models.ServiceMeshMode": "Microsoft.ContainerService.ServiceMeshMode", + "azure.mgmt.containerservice.models.IstioIngressGatewayMode": "Microsoft.ContainerService.IstioIngressGatewayMode", + "azure.mgmt.containerservice.models.ProxyRedirectionMechanism": "Microsoft.ContainerService.ProxyRedirectionMechanism", + "azure.mgmt.containerservice.models.NodeProvisioningMode": "Microsoft.ContainerService.NodeProvisioningMode", + "azure.mgmt.containerservice.models.NodeProvisioningDefaultNodePools": "Microsoft.ContainerService.NodeProvisioningDefaultNodePools", + "azure.mgmt.containerservice.models.ArtifactSource": "Microsoft.ContainerService.ArtifactSource", + "azure.mgmt.containerservice.models.SchedulerConfigMode": "Microsoft.ContainerService.SchedulerConfigMode", + "azure.mgmt.containerservice.models.ManagedClusterSKUName": "Microsoft.ContainerService.ManagedClusterSKUName", + "azure.mgmt.containerservice.models.ManagedClusterSKUTier": "Microsoft.ContainerService.ManagedClusterSKUTier", + "azure.mgmt.containerservice.models.ExtendedLocationTypes": "Microsoft.ContainerService.ExtendedLocationTypes", + "azure.mgmt.containerservice.models.ResourceIdentityType": "Microsoft.ContainerService.ResourceIdentityType", + "azure.mgmt.containerservice.models.Format": "Microsoft.ContainerService.Format", + "azure.mgmt.containerservice.models.GuardrailsSupport": "Microsoft.ContainerService.GuardrailsSupport", + "azure.mgmt.containerservice.models.SafeguardsSupport": "Microsoft.ContainerService.SafeguardsSupport", + "azure.mgmt.containerservice.models.WeekDay": "Microsoft.ContainerService.WeekDay", + "azure.mgmt.containerservice.models.Type": "Microsoft.ContainerService.Type", + "azure.mgmt.containerservice.models.NamespaceProvisioningState": "Microsoft.ContainerService.NamespaceProvisioningState", + "azure.mgmt.containerservice.models.PolicyRule": "Microsoft.ContainerService.PolicyRule", + "azure.mgmt.containerservice.models.AdoptionPolicy": "Microsoft.ContainerService.AdoptionPolicy", + "azure.mgmt.containerservice.models.DeletePolicy": "Microsoft.ContainerService.DeletePolicy", + "azure.mgmt.containerservice.models.DriftAction": "Microsoft.ContainerService.DriftAction", + "azure.mgmt.containerservice.models.VmState": "Microsoft.ContainerService.VmState", + "azure.mgmt.containerservice.models.PrivateEndpointConnectionProvisioningState": "Microsoft.ContainerService.PrivateEndpointConnectionProvisioningState", + "azure.mgmt.containerservice.models.ConnectionStatus": "Microsoft.ContainerService.ConnectionStatus", + "azure.mgmt.containerservice.models.SnapshotType": "Microsoft.ContainerService.SnapshotType", + "azure.mgmt.containerservice.models.TrustedAccessRoleBindingProvisioningState": "Microsoft.ContainerService.TrustedAccessRoleBindingProvisioningState", + "azure.mgmt.containerservice.models.Operator": "Microsoft.ContainerService.Operator", + "azure.mgmt.containerservice.models.IdentityBindingProvisioningState": "Microsoft.ContainerService.IdentityBindingProvisioningState", + "azure.mgmt.containerservice.models.JWTAuthenticatorProvisioningState": "Microsoft.ContainerService.JWTAuthenticatorProvisioningState", + "azure.mgmt.containerservice.models.MeshMembershipProvisioningState": "Microsoft.ContainerService.MeshMembershipProvisioningState", + "azure.mgmt.containerservice.operations.AgentPoolsOperations.get": "Microsoft.ContainerService.AgentPools.get", + "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.get": "Microsoft.ContainerService.AgentPools.get", + "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_create_or_update": "Microsoft.ContainerService.AgentPools.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_create_or_update": "Microsoft.ContainerService.AgentPools.createOrUpdate", + "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_delete": "Microsoft.ContainerService.AgentPools.delete", + "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_delete": "Microsoft.ContainerService.AgentPools.delete", + "azure.mgmt.containerservice.operations.AgentPoolsOperations.list": "Microsoft.ContainerService.AgentPools.list", + "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.list": "Microsoft.ContainerService.AgentPools.list", + "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_abort_latest_operation": "Microsoft.ContainerService.AgentPools.abortLatestOperation", + "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_abort_latest_operation": "Microsoft.ContainerService.AgentPools.abortLatestOperation", + "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_complete_upgrade": "Microsoft.ContainerService.AgentPools.completeUpgrade", + "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_complete_upgrade": "Microsoft.ContainerService.AgentPools.completeUpgrade", + "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_delete_machines": "Microsoft.ContainerService.AgentPools.deleteMachines", + "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_delete_machines": "Microsoft.ContainerService.AgentPools.deleteMachines", + "azure.mgmt.containerservice.operations.AgentPoolsOperations.begin_upgrade_node_image_version": "Microsoft.ContainerService.AgentPools.upgradeNodeImageVersion", + "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.begin_upgrade_node_image_version": "Microsoft.ContainerService.AgentPools.upgradeNodeImageVersion", + "azure.mgmt.containerservice.operations.AgentPoolsOperations.get_available_agent_pool_versions": "Microsoft.ContainerService.ManagedClusters.getAvailableAgentPoolVersions", + "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.get_available_agent_pool_versions": "Microsoft.ContainerService.ManagedClusters.getAvailableAgentPoolVersions", + "azure.mgmt.containerservice.operations.AgentPoolsOperations.get_upgrade_profile": "Microsoft.ContainerService.AgentPoolUpgradeProfiles.getUpgradeProfile", + "azure.mgmt.containerservice.aio.operations.AgentPoolsOperations.get_upgrade_profile": "Microsoft.ContainerService.AgentPoolUpgradeProfiles.getUpgradeProfile", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.get": "Microsoft.ContainerService.ManagedClusters.get", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get": "Microsoft.ContainerService.ManagedClusters.get", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_create_or_update": "Microsoft.ContainerService.ManagedClusters.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_create_or_update": "Microsoft.ContainerService.ManagedClusters.createOrUpdate", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_update_tags": "Microsoft.ContainerService.ManagedClusters.updateTags", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_update_tags": "Microsoft.ContainerService.ManagedClusters.updateTags", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_delete": "Microsoft.ContainerService.ManagedClusters.delete", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_delete": "Microsoft.ContainerService.ManagedClusters.delete", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_by_resource_group": "Microsoft.ContainerService.ManagedClusters.listByResourceGroup", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_by_resource_group": "Microsoft.ContainerService.ManagedClusters.listByResourceGroup", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list": "Microsoft.ContainerService.ManagedClusters.list", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list": "Microsoft.ContainerService.ManagedClusters.list", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_access_profile": "Microsoft.ContainerService.ManagedClusters.getAccessProfile", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_access_profile": "Microsoft.ContainerService.ManagedClusters.getAccessProfile", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_cluster_admin_credentials": "Microsoft.ContainerService.ManagedClusters.listClusterAdminCredentials", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_cluster_admin_credentials": "Microsoft.ContainerService.ManagedClusters.listClusterAdminCredentials", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_cluster_user_credentials": "Microsoft.ContainerService.ManagedClusters.listClusterUserCredentials", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_cluster_user_credentials": "Microsoft.ContainerService.ManagedClusters.listClusterUserCredentials", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_cluster_monitoring_user_credentials": "Microsoft.ContainerService.ManagedClusters.listClusterMonitoringUserCredentials", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_cluster_monitoring_user_credentials": "Microsoft.ContainerService.ManagedClusters.listClusterMonitoringUserCredentials", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_reset_service_principal_profile": "Microsoft.ContainerService.ManagedClusters.resetServicePrincipalProfile", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_reset_service_principal_profile": "Microsoft.ContainerService.ManagedClusters.resetServicePrincipalProfile", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_reset_aad_profile": "Microsoft.ContainerService.ManagedClusters.resetAADProfile", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_reset_aad_profile": "Microsoft.ContainerService.ManagedClusters.resetAADProfile", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_rotate_cluster_certificates": "Microsoft.ContainerService.ManagedClusters.rotateClusterCertificates", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_rotate_cluster_certificates": "Microsoft.ContainerService.ManagedClusters.rotateClusterCertificates", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_abort_latest_operation": "Microsoft.ContainerService.ManagedClusters.abortLatestOperation", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_abort_latest_operation": "Microsoft.ContainerService.ManagedClusters.abortLatestOperation", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_rotate_service_account_signing_keys": "Microsoft.ContainerService.ManagedClusters.rotateServiceAccountSigningKeys", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_rotate_service_account_signing_keys": "Microsoft.ContainerService.ManagedClusters.rotateServiceAccountSigningKeys", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_stop": "Microsoft.ContainerService.ManagedClusters.stop", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_stop": "Microsoft.ContainerService.ManagedClusters.stop", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_start": "Microsoft.ContainerService.ManagedClusters.start", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_start": "Microsoft.ContainerService.ManagedClusters.start", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_run_command": "Microsoft.ContainerService.ManagedClusters.runCommand", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_run_command": "Microsoft.ContainerService.ManagedClusters.runCommand", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_command_result": "Microsoft.ContainerService.ManagedClusters.getCommandResult", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_command_result": "Microsoft.ContainerService.ManagedClusters.getCommandResult", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_outbound_network_dependencies_endpoints": "Microsoft.ContainerService.ManagedClusters.listOutboundNetworkDependenciesEndpoints", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_outbound_network_dependencies_endpoints": "Microsoft.ContainerService.ManagedClusters.listOutboundNetworkDependenciesEndpoints", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.begin_rebalance_load_balancers": "Microsoft.ContainerService.ManagedClusters.rebalanceLoadBalancers", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.begin_rebalance_load_balancers": "Microsoft.ContainerService.ManagedClusters.rebalanceLoadBalancers", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_upgrade_profile": "Microsoft.ContainerService.ManagedClusterUpgradeProfiles.getUpgradeProfile", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_upgrade_profile": "Microsoft.ContainerService.ManagedClusterUpgradeProfiles.getUpgradeProfile", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_guardrails_versions": "Microsoft.ContainerService.GuardrailsAvailableVersions.getGuardrailsVersions", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_guardrails_versions": "Microsoft.ContainerService.GuardrailsAvailableVersions.getGuardrailsVersions", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_guardrails_versions": "Microsoft.ContainerService.GuardrailsAvailableVersions.listGuardrailsVersions", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_guardrails_versions": "Microsoft.ContainerService.GuardrailsAvailableVersions.listGuardrailsVersions", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_safeguards_versions": "Microsoft.ContainerService.SafeguardsAvailableVersions.getSafeguardsVersions", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_safeguards_versions": "Microsoft.ContainerService.SafeguardsAvailableVersions.getSafeguardsVersions", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_safeguards_versions": "Microsoft.ContainerService.SafeguardsAvailableVersions.listSafeguardsVersions", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_safeguards_versions": "Microsoft.ContainerService.SafeguardsAvailableVersions.listSafeguardsVersions", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_mesh_revision_profile": "Microsoft.ContainerService.MeshRevisionProfiles.getMeshRevisionProfile", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_mesh_revision_profile": "Microsoft.ContainerService.MeshRevisionProfiles.getMeshRevisionProfile", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_mesh_revision_profiles": "Microsoft.ContainerService.MeshRevisionProfiles.listMeshRevisionProfiles", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_mesh_revision_profiles": "Microsoft.ContainerService.MeshRevisionProfiles.listMeshRevisionProfiles", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.get_mesh_upgrade_profile": "Microsoft.ContainerService.MeshUpgradeProfiles.getMeshUpgradeProfile", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.get_mesh_upgrade_profile": "Microsoft.ContainerService.MeshUpgradeProfiles.getMeshUpgradeProfile", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_mesh_upgrade_profiles": "Microsoft.ContainerService.MeshUpgradeProfiles.listMeshUpgradeProfiles", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_mesh_upgrade_profiles": "Microsoft.ContainerService.MeshUpgradeProfiles.listMeshUpgradeProfiles", + "azure.mgmt.containerservice.operations.ManagedClustersOperations.list_kubernetes_versions": "Microsoft.ContainerService.ManagedClustersOperationGroup.listKubernetesVersions", + "azure.mgmt.containerservice.aio.operations.ManagedClustersOperations.list_kubernetes_versions": "Microsoft.ContainerService.ManagedClustersOperationGroup.listKubernetesVersions", + "azure.mgmt.containerservice.operations.MaintenanceConfigurationsOperations.get": "Microsoft.ContainerService.MaintenanceConfigurations.get", + "azure.mgmt.containerservice.aio.operations.MaintenanceConfigurationsOperations.get": "Microsoft.ContainerService.MaintenanceConfigurations.get", + "azure.mgmt.containerservice.operations.MaintenanceConfigurationsOperations.create_or_update": "Microsoft.ContainerService.MaintenanceConfigurations.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.MaintenanceConfigurationsOperations.create_or_update": "Microsoft.ContainerService.MaintenanceConfigurations.createOrUpdate", + "azure.mgmt.containerservice.operations.MaintenanceConfigurationsOperations.delete": "Microsoft.ContainerService.MaintenanceConfigurations.delete", + "azure.mgmt.containerservice.aio.operations.MaintenanceConfigurationsOperations.delete": "Microsoft.ContainerService.MaintenanceConfigurations.delete", + "azure.mgmt.containerservice.operations.MaintenanceConfigurationsOperations.list_by_managed_cluster": "Microsoft.ContainerService.MaintenanceConfigurations.listByManagedCluster", + "azure.mgmt.containerservice.aio.operations.MaintenanceConfigurationsOperations.list_by_managed_cluster": "Microsoft.ContainerService.MaintenanceConfigurations.listByManagedCluster", + "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.get": "Microsoft.ContainerService.ManagedNamespaces.get", + "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.get": "Microsoft.ContainerService.ManagedNamespaces.get", + "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.begin_create_or_update": "Microsoft.ContainerService.ManagedNamespaces.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.begin_create_or_update": "Microsoft.ContainerService.ManagedNamespaces.createOrUpdate", + "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.update": "Microsoft.ContainerService.ManagedNamespaces.update", + "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.update": "Microsoft.ContainerService.ManagedNamespaces.update", + "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.begin_delete": "Microsoft.ContainerService.ManagedNamespaces.delete", + "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.begin_delete": "Microsoft.ContainerService.ManagedNamespaces.delete", + "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.list_by_managed_cluster": "Microsoft.ContainerService.ManagedNamespaces.listByManagedCluster", + "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.list_by_managed_cluster": "Microsoft.ContainerService.ManagedNamespaces.listByManagedCluster", + "azure.mgmt.containerservice.operations.ManagedNamespacesOperations.list_credential": "Microsoft.ContainerService.ManagedNamespaces.listCredential", + "azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations.list_credential": "Microsoft.ContainerService.ManagedNamespaces.listCredential", + "azure.mgmt.containerservice.operations.MachinesOperations.get": "Microsoft.ContainerService.Machines.get", + "azure.mgmt.containerservice.aio.operations.MachinesOperations.get": "Microsoft.ContainerService.Machines.get", + "azure.mgmt.containerservice.operations.MachinesOperations.begin_create_or_update": "Microsoft.ContainerService.Machines.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.MachinesOperations.begin_create_or_update": "Microsoft.ContainerService.Machines.createOrUpdate", + "azure.mgmt.containerservice.operations.MachinesOperations.list": "Microsoft.ContainerService.Machines.list", + "azure.mgmt.containerservice.aio.operations.MachinesOperations.list": "Microsoft.ContainerService.Machines.list", + "azure.mgmt.containerservice.operations.PrivateEndpointConnectionsOperations.get": "Microsoft.ContainerService.PrivateEndpointConnections.get", + "azure.mgmt.containerservice.aio.operations.PrivateEndpointConnectionsOperations.get": "Microsoft.ContainerService.PrivateEndpointConnections.get", + "azure.mgmt.containerservice.operations.PrivateEndpointConnectionsOperations.update": "Microsoft.ContainerService.PrivateEndpointConnections.update", + "azure.mgmt.containerservice.aio.operations.PrivateEndpointConnectionsOperations.update": "Microsoft.ContainerService.PrivateEndpointConnections.update", + "azure.mgmt.containerservice.operations.PrivateEndpointConnectionsOperations.begin_delete": "Microsoft.ContainerService.PrivateEndpointConnections.delete", + "azure.mgmt.containerservice.aio.operations.PrivateEndpointConnectionsOperations.begin_delete": "Microsoft.ContainerService.PrivateEndpointConnections.delete", + "azure.mgmt.containerservice.operations.PrivateEndpointConnectionsOperations.list": "Microsoft.ContainerService.PrivateEndpointConnections.list", + "azure.mgmt.containerservice.aio.operations.PrivateEndpointConnectionsOperations.list": "Microsoft.ContainerService.PrivateEndpointConnections.list", + "azure.mgmt.containerservice.operations.SnapshotsOperations.get": "Microsoft.ContainerService.Snapshots.get", + "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.get": "Microsoft.ContainerService.Snapshots.get", + "azure.mgmt.containerservice.operations.SnapshotsOperations.create_or_update": "Microsoft.ContainerService.Snapshots.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.create_or_update": "Microsoft.ContainerService.Snapshots.createOrUpdate", + "azure.mgmt.containerservice.operations.SnapshotsOperations.update_tags": "Microsoft.ContainerService.Snapshots.updateTags", + "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.update_tags": "Microsoft.ContainerService.Snapshots.updateTags", + "azure.mgmt.containerservice.operations.SnapshotsOperations.delete": "Microsoft.ContainerService.Snapshots.delete", + "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.delete": "Microsoft.ContainerService.Snapshots.delete", + "azure.mgmt.containerservice.operations.SnapshotsOperations.list_by_resource_group": "Microsoft.ContainerService.Snapshots.listByResourceGroup", + "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.list_by_resource_group": "Microsoft.ContainerService.Snapshots.listByResourceGroup", + "azure.mgmt.containerservice.operations.SnapshotsOperations.list": "Microsoft.ContainerService.Snapshots.list", + "azure.mgmt.containerservice.aio.operations.SnapshotsOperations.list": "Microsoft.ContainerService.Snapshots.list", + "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.get": "Microsoft.ContainerService.ManagedClusterSnapshots.get", + "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.get": "Microsoft.ContainerService.ManagedClusterSnapshots.get", + "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.create_or_update": "Microsoft.ContainerService.ManagedClusterSnapshots.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.create_or_update": "Microsoft.ContainerService.ManagedClusterSnapshots.createOrUpdate", + "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.update_tags": "Microsoft.ContainerService.ManagedClusterSnapshots.updateTags", + "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.update_tags": "Microsoft.ContainerService.ManagedClusterSnapshots.updateTags", + "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.delete": "Microsoft.ContainerService.ManagedClusterSnapshots.delete", + "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.delete": "Microsoft.ContainerService.ManagedClusterSnapshots.delete", + "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.list_by_resource_group": "Microsoft.ContainerService.ManagedClusterSnapshots.listByResourceGroup", + "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.list_by_resource_group": "Microsoft.ContainerService.ManagedClusterSnapshots.listByResourceGroup", + "azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations.list": "Microsoft.ContainerService.ManagedClusterSnapshots.list", + "azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations.list": "Microsoft.ContainerService.ManagedClusterSnapshots.list", + "azure.mgmt.containerservice.operations.TrustedAccessRoleBindingsOperations.get": "Microsoft.ContainerService.TrustedAccessRoleBindings.get", + "azure.mgmt.containerservice.aio.operations.TrustedAccessRoleBindingsOperations.get": "Microsoft.ContainerService.TrustedAccessRoleBindings.get", + "azure.mgmt.containerservice.operations.TrustedAccessRoleBindingsOperations.begin_create_or_update": "Microsoft.ContainerService.TrustedAccessRoleBindings.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.TrustedAccessRoleBindingsOperations.begin_create_or_update": "Microsoft.ContainerService.TrustedAccessRoleBindings.createOrUpdate", + "azure.mgmt.containerservice.operations.TrustedAccessRoleBindingsOperations.begin_delete": "Microsoft.ContainerService.TrustedAccessRoleBindings.delete", + "azure.mgmt.containerservice.aio.operations.TrustedAccessRoleBindingsOperations.begin_delete": "Microsoft.ContainerService.TrustedAccessRoleBindings.delete", + "azure.mgmt.containerservice.operations.TrustedAccessRoleBindingsOperations.list": "Microsoft.ContainerService.TrustedAccessRoleBindings.list", + "azure.mgmt.containerservice.aio.operations.TrustedAccessRoleBindingsOperations.list": "Microsoft.ContainerService.TrustedAccessRoleBindings.list", + "azure.mgmt.containerservice.operations.LoadBalancersOperations.get": "Microsoft.ContainerService.LoadBalancers.get", + "azure.mgmt.containerservice.aio.operations.LoadBalancersOperations.get": "Microsoft.ContainerService.LoadBalancers.get", + "azure.mgmt.containerservice.operations.LoadBalancersOperations.create_or_update": "Microsoft.ContainerService.LoadBalancers.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.LoadBalancersOperations.create_or_update": "Microsoft.ContainerService.LoadBalancers.createOrUpdate", + "azure.mgmt.containerservice.operations.LoadBalancersOperations.begin_delete": "Microsoft.ContainerService.LoadBalancers.delete", + "azure.mgmt.containerservice.aio.operations.LoadBalancersOperations.begin_delete": "Microsoft.ContainerService.LoadBalancers.delete", + "azure.mgmt.containerservice.operations.LoadBalancersOperations.list_by_managed_cluster": "Microsoft.ContainerService.LoadBalancers.listByManagedCluster", + "azure.mgmt.containerservice.aio.operations.LoadBalancersOperations.list_by_managed_cluster": "Microsoft.ContainerService.LoadBalancers.listByManagedCluster", + "azure.mgmt.containerservice.operations.IdentityBindingsOperations.get": "Microsoft.ContainerService.IdentityBindings.get", + "azure.mgmt.containerservice.aio.operations.IdentityBindingsOperations.get": "Microsoft.ContainerService.IdentityBindings.get", + "azure.mgmt.containerservice.operations.IdentityBindingsOperations.begin_create_or_update": "Microsoft.ContainerService.IdentityBindings.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.IdentityBindingsOperations.begin_create_or_update": "Microsoft.ContainerService.IdentityBindings.createOrUpdate", + "azure.mgmt.containerservice.operations.IdentityBindingsOperations.begin_delete": "Microsoft.ContainerService.IdentityBindings.delete", + "azure.mgmt.containerservice.aio.operations.IdentityBindingsOperations.begin_delete": "Microsoft.ContainerService.IdentityBindings.delete", + "azure.mgmt.containerservice.operations.IdentityBindingsOperations.list_by_managed_cluster": "Microsoft.ContainerService.IdentityBindings.listByManagedCluster", + "azure.mgmt.containerservice.aio.operations.IdentityBindingsOperations.list_by_managed_cluster": "Microsoft.ContainerService.IdentityBindings.listByManagedCluster", + "azure.mgmt.containerservice.operations.JWTAuthenticatorsOperations.get": "Microsoft.ContainerService.JWTAuthenticators.get", + "azure.mgmt.containerservice.aio.operations.JWTAuthenticatorsOperations.get": "Microsoft.ContainerService.JWTAuthenticators.get", + "azure.mgmt.containerservice.operations.JWTAuthenticatorsOperations.begin_create_or_update": "Microsoft.ContainerService.JWTAuthenticators.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.JWTAuthenticatorsOperations.begin_create_or_update": "Microsoft.ContainerService.JWTAuthenticators.createOrUpdate", + "azure.mgmt.containerservice.operations.JWTAuthenticatorsOperations.begin_delete": "Microsoft.ContainerService.JWTAuthenticators.delete", + "azure.mgmt.containerservice.aio.operations.JWTAuthenticatorsOperations.begin_delete": "Microsoft.ContainerService.JWTAuthenticators.delete", + "azure.mgmt.containerservice.operations.JWTAuthenticatorsOperations.list_by_managed_cluster": "Microsoft.ContainerService.JWTAuthenticators.listByManagedCluster", + "azure.mgmt.containerservice.aio.operations.JWTAuthenticatorsOperations.list_by_managed_cluster": "Microsoft.ContainerService.JWTAuthenticators.listByManagedCluster", + "azure.mgmt.containerservice.operations.MeshMembershipsOperations.get": "Microsoft.ContainerService.MeshMemberships.get", + "azure.mgmt.containerservice.aio.operations.MeshMembershipsOperations.get": "Microsoft.ContainerService.MeshMemberships.get", + "azure.mgmt.containerservice.operations.MeshMembershipsOperations.begin_create_or_update": "Microsoft.ContainerService.MeshMemberships.createOrUpdate", + "azure.mgmt.containerservice.aio.operations.MeshMembershipsOperations.begin_create_or_update": "Microsoft.ContainerService.MeshMemberships.createOrUpdate", + "azure.mgmt.containerservice.operations.MeshMembershipsOperations.begin_delete": "Microsoft.ContainerService.MeshMemberships.delete", + "azure.mgmt.containerservice.aio.operations.MeshMembershipsOperations.begin_delete": "Microsoft.ContainerService.MeshMemberships.delete", + "azure.mgmt.containerservice.operations.MeshMembershipsOperations.list_by_managed_cluster": "Microsoft.ContainerService.MeshMemberships.listByManagedCluster", + "azure.mgmt.containerservice.aio.operations.MeshMembershipsOperations.list_by_managed_cluster": "Microsoft.ContainerService.MeshMemberships.listByManagedCluster", + "azure.mgmt.containerservice.operations.Operations.list": "Microsoft.ContainerService.Operations.list", + "azure.mgmt.containerservice.aio.operations.Operations.list": "Microsoft.ContainerService.Operations.list", + "azure.mgmt.containerservice.operations.OperationStatusResultOperations.get_by_agent_pool": "Microsoft.ContainerService.AgentPools.getByAgentPool", + "azure.mgmt.containerservice.aio.operations.OperationStatusResultOperations.get_by_agent_pool": "Microsoft.ContainerService.AgentPools.getByAgentPool", + "azure.mgmt.containerservice.operations.OperationStatusResultOperations.list": "Microsoft.ContainerService.ManagedClusters.operationStatusResultList", + "azure.mgmt.containerservice.aio.operations.OperationStatusResultOperations.list": "Microsoft.ContainerService.ManagedClusters.operationStatusResultList", + "azure.mgmt.containerservice.operations.OperationStatusResultOperations.get": "Microsoft.ContainerService.ManagedClusters.operationStatusResultGet", + "azure.mgmt.containerservice.aio.operations.OperationStatusResultOperations.get": "Microsoft.ContainerService.ManagedClusters.operationStatusResultGet", + "azure.mgmt.containerservice.operations.PrivateLinkResourcesOperations.list": "Microsoft.ContainerService.ManagedClusters.privateLinkResourcesList", + "azure.mgmt.containerservice.aio.operations.PrivateLinkResourcesOperations.list": "Microsoft.ContainerService.ManagedClusters.privateLinkResourcesList", + "azure.mgmt.containerservice.operations.ResolvePrivateLinkServiceIdOperations.post": "Microsoft.ContainerService.ManagedClusters.post", + "azure.mgmt.containerservice.aio.operations.ResolvePrivateLinkServiceIdOperations.post": "Microsoft.ContainerService.ManagedClusters.post", + "azure.mgmt.containerservice.operations.TrustedAccessRolesOperations.list": "Microsoft.ContainerService.TrustedAccessRolesOperationGroup.list", + "azure.mgmt.containerservice.aio.operations.TrustedAccessRolesOperations.list": "Microsoft.ContainerService.TrustedAccessRolesOperationGroup.list", + "azure.mgmt.containerservice.operations.ContainerServiceOperations.list_node_image_versions": "Microsoft.ContainerService.ContainerServiceOperationGroup.listNodeImageVersions", + "azure.mgmt.containerservice.aio.operations.ContainerServiceOperations.list_node_image_versions": "Microsoft.ContainerService.ContainerServiceOperationGroup.listNodeImageVersions" } } \ 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 999067d049ca..ef8994d923e4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._container_service_client import ContainerServiceClient # type: ignore +from ._client import ContainerServiceClient # type: ignore 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/_client.py similarity index 91% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_client.py index fdc347b729a7..e8b8f76f417f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_container_service_client.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_client.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -17,7 +17,6 @@ from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from azure.mgmt.core.tools import get_arm_endpoints -from . import models as _models from ._configuration import ContainerServiceClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( @@ -50,41 +49,25 @@ class ContainerServiceClient: # pylint: disable=too-many-instance-attributes """The Container Service Client. - :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerservice.operations.Operations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: azure.mgmt.containerservice.operations.AgentPoolsOperations :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.operations.ManagedClustersOperations - :ivar container_service: ContainerServiceOperations operations - :vartype container_service: azure.mgmt.containerservice.operations.ContainerServiceOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations :vartype maintenance_configurations: azure.mgmt.containerservice.operations.MaintenanceConfigurationsOperations :ivar managed_namespaces: ManagedNamespacesOperations operations :vartype managed_namespaces: azure.mgmt.containerservice.operations.ManagedNamespacesOperations - :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.operations.AgentPoolsOperations :ivar machines: MachinesOperations operations :vartype machines: azure.mgmt.containerservice.operations.MachinesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: azure.mgmt.containerservice.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.containerservice.operations.PrivateLinkResourcesOperations - :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: - azure.mgmt.containerservice.operations.ResolvePrivateLinkServiceIdOperations - :ivar operation_status_result: OperationStatusResultOperations operations - :vartype operation_status_result: - azure.mgmt.containerservice.operations.OperationStatusResultOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: azure.mgmt.containerservice.operations.SnapshotsOperations :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations :vartype managed_cluster_snapshots: azure.mgmt.containerservice.operations.ManagedClusterSnapshotsOperations - :ivar trusted_access_roles: TrustedAccessRolesOperations operations - :vartype trusted_access_roles: - azure.mgmt.containerservice.operations.TrustedAccessRolesOperations :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations :vartype trusted_access_role_bindings: azure.mgmt.containerservice.operations.TrustedAccessRoleBindingsOperations @@ -96,17 +79,34 @@ class ContainerServiceClient: # pylint: disable=too-many-instance-attributes :vartype jwt_authenticators: azure.mgmt.containerservice.operations.JWTAuthenticatorsOperations :ivar mesh_memberships: MeshMembershipsOperations operations :vartype mesh_memberships: azure.mgmt.containerservice.operations.MeshMembershipsOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.operations.Operations + :ivar operation_status_result: OperationStatusResultOperations operations + :vartype operation_status_result: + azure.mgmt.containerservice.operations.OperationStatusResultOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.operations.ResolvePrivateLinkServiceIdOperations + :ivar trusted_access_roles: TrustedAccessRolesOperations operations + :vartype trusted_access_roles: + azure.mgmt.containerservice.operations.TrustedAccessRolesOperations + :ivar container_service: ContainerServiceOperations operations + :vartype container_service: azure.mgmt.containerservice.operations.ContainerServiceOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is None. + :param base_url: Service host. Default value is None. :type base_url: str :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2025-10-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2025-10-02-preview" and None. Default value is "2025-10-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. @@ -121,6 +121,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: @@ -129,6 +130,7 @@ def __init__( self._config = ContainerServiceClientConfiguration( credential=credential, subscription_id=subscription_id, + base_url=cast(str, base_url), cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs @@ -152,67 +154,66 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.container_service = ContainerServiceOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.maintenance_configurations = MaintenanceConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize ) self.managed_namespaces = ManagedNamespacesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.machines = MachinesOperations(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.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) + self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.operation_status_result = OperationStatusResultOperations( + self.load_balancers = LoadBalancersOperations(self._client, self._config, self._serialize, self._deserialize) + self.identity_bindings = IdentityBindingsOperations( 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.jwt_authenticators = JWTAuthenticatorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.trusted_access_roles = TrustedAccessRolesOperations( + self.mesh_memberships = MeshMembershipsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status_result = OperationStatusResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.load_balancers = LoadBalancersOperations(self._client, self._config, self._serialize, self._deserialize) - self.identity_bindings = IdentityBindingsOperations( + self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.jwt_authenticators = JWTAuthenticatorsOperations( + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( self._client, self._config, self._serialize, self._deserialize ) - self.mesh_memberships = MeshMembershipsOperations( + self.trusted_access_roles = TrustedAccessRolesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.container_service = ContainerServiceOperations( self._client, self._config, self._serialize, self._deserialize ) - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = client._send_request(request) + >>> response = client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -225,7 +226,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_configuration.py index 308ee7ac74c9..0a8509088e91 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -24,15 +24,18 @@ class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance- 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. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2025-10-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2025-10-02-preview" and None. Default value is "2025-10-02-preview". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ @@ -40,6 +43,7 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, + base_url: str = "https://management.azure.com", cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: @@ -52,6 +56,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_patch.py @@ -7,9 +7,9 @@ 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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/__init__.py index 0af9b28f6607..8026245c2abc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/__init__.py @@ -1,6 +1,6 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/model_base.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/model_base.py new file mode 100644 index 000000000000..9616929f7415 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/model_base.py @@ -0,0 +1,1362 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +from typing_extensions import Self +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null +from azure.core.rest import HttpResponse + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { + Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf + for attr, rf in cls._attr_to_rest_field.items() + } + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: + rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access + if rest_field_obj is None: + return attr_name + original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access + if original_tsp_name: + return original_tsp_name + return attr_name + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + self._original_tsp_name = original_tsp_name + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + original_tsp_name=original_tsp_name, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/serialization.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/serialization.py index ff543ed937ff..81ec1de5922b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/serialization.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/serialization.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -821,13 +821,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1757,7 +1764,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1783,7 +1790,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/utils.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/utils.py new file mode 100644 index 000000000000..cbaa624660e4 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_utils/utils.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Optional + +from azure.core import MatchConditions + + +def quote_etag(etag: Optional[str]) -> Optional[str]: + if not etag or etag == "*": + return etag + if etag.startswith("W/"): + return etag + if etag.startswith('"') and etag.endswith('"'): + return etag + if etag.startswith("'") and etag.endswith("'"): + return etag + return '"' + etag + '"' + + +def prep_if_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfNotModified: + if_match = quote_etag(etag) if etag else None + return if_match + if match_condition == MatchConditions.IfPresent: + return "*" + return None + + +def prep_if_none_match(etag: Optional[str], match_condition: Optional[MatchConditions]) -> Optional[str]: + if match_condition == MatchConditions.IfModified: + if_none_match = quote_etag(etag) if etag else None + return if_none_match + if match_condition == MatchConditions.IfMissing: + return "*" + return None diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_validation.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_validation.py new file mode 100644 index 000000000000..f5af3a4eb8a2 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_validation.py @@ -0,0 +1,66 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + api_versions_list = kwargs.pop("api_versions_list", []) + + def _index_with_default(value: str, default: int = -1) -> int: + """Get the index of value in lst, or return default if not found. + + :param value: The value to search for in the api_versions_list. + :type value: str + :param default: The default value to return if the value is not found. + :type default: int + :return: The index of the value in the list, or the default value if not found. + :rtype: int + """ + try: + return api_versions_list.index(value) + except ValueError: + return default + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if _index_with_default(method_added_on) > _index_with_default(client_api_version): + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and _index_with_default(api_version) > _index_with_default(client_api_version) + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py index 48a57352bcb4..d248169cef96 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/_version.py @@ -1,8 +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. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "41.0.0b3" +VERSION = "41.0.0b4" diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/__init__.py index a55668168f09..a3123ec4e5af 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._container_service_client import ContainerServiceClient # type: ignore +from ._client import ContainerServiceClient # type: ignore try: from ._patch import __all__ as _patch_all 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/_client.py similarity index 92% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_container_service_client.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_client.py index 3e0955f4349a..55039f5f2334 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/_client.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -17,7 +17,6 @@ from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from azure.mgmt.core.tools import get_arm_endpoints -from .. import models as _models from .._utils.serialization import Deserializer, Serializer from ._configuration import ContainerServiceClientConfiguration from .operations import ( @@ -50,43 +49,26 @@ class ContainerServiceClient: # pylint: disable=too-many-instance-attributes """The Container Service Client. - :ivar operations: Operations operations - :vartype operations: azure.mgmt.containerservice.aio.operations.Operations + :ivar agent_pools: AgentPoolsOperations operations + :vartype agent_pools: azure.mgmt.containerservice.aio.operations.AgentPoolsOperations :ivar managed_clusters: ManagedClustersOperations operations :vartype managed_clusters: azure.mgmt.containerservice.aio.operations.ManagedClustersOperations - :ivar container_service: ContainerServiceOperations operations - :vartype container_service: - azure.mgmt.containerservice.aio.operations.ContainerServiceOperations :ivar maintenance_configurations: MaintenanceConfigurationsOperations operations :vartype maintenance_configurations: azure.mgmt.containerservice.aio.operations.MaintenanceConfigurationsOperations :ivar managed_namespaces: ManagedNamespacesOperations operations :vartype managed_namespaces: azure.mgmt.containerservice.aio.operations.ManagedNamespacesOperations - :ivar agent_pools: AgentPoolsOperations operations - :vartype agent_pools: azure.mgmt.containerservice.aio.operations.AgentPoolsOperations :ivar machines: MachinesOperations operations :vartype machines: azure.mgmt.containerservice.aio.operations.MachinesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: azure.mgmt.containerservice.aio.operations.PrivateEndpointConnectionsOperations - :ivar private_link_resources: PrivateLinkResourcesOperations operations - :vartype private_link_resources: - azure.mgmt.containerservice.aio.operations.PrivateLinkResourcesOperations - :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations - :vartype resolve_private_link_service_id: - azure.mgmt.containerservice.aio.operations.ResolvePrivateLinkServiceIdOperations - :ivar operation_status_result: OperationStatusResultOperations operations - :vartype operation_status_result: - azure.mgmt.containerservice.aio.operations.OperationStatusResultOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: azure.mgmt.containerservice.aio.operations.SnapshotsOperations :ivar managed_cluster_snapshots: ManagedClusterSnapshotsOperations operations :vartype managed_cluster_snapshots: azure.mgmt.containerservice.aio.operations.ManagedClusterSnapshotsOperations - :ivar trusted_access_roles: TrustedAccessRolesOperations operations - :vartype trusted_access_roles: - azure.mgmt.containerservice.aio.operations.TrustedAccessRolesOperations :ivar trusted_access_role_bindings: TrustedAccessRoleBindingsOperations operations :vartype trusted_access_role_bindings: azure.mgmt.containerservice.aio.operations.TrustedAccessRoleBindingsOperations @@ -100,17 +82,35 @@ class ContainerServiceClient: # pylint: disable=too-many-instance-attributes azure.mgmt.containerservice.aio.operations.JWTAuthenticatorsOperations :ivar mesh_memberships: MeshMembershipsOperations operations :vartype mesh_memberships: azure.mgmt.containerservice.aio.operations.MeshMembershipsOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar operations: Operations operations + :vartype operations: azure.mgmt.containerservice.aio.operations.Operations + :ivar operation_status_result: OperationStatusResultOperations operations + :vartype operation_status_result: + azure.mgmt.containerservice.aio.operations.OperationStatusResultOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: + azure.mgmt.containerservice.aio.operations.PrivateLinkResourcesOperations + :ivar resolve_private_link_service_id: ResolvePrivateLinkServiceIdOperations operations + :vartype resolve_private_link_service_id: + azure.mgmt.containerservice.aio.operations.ResolvePrivateLinkServiceIdOperations + :ivar trusted_access_roles: TrustedAccessRolesOperations operations + :vartype trusted_access_roles: + azure.mgmt.containerservice.aio.operations.TrustedAccessRolesOperations + :ivar container_service: ContainerServiceOperations operations + :vartype container_service: + azure.mgmt.containerservice.aio.operations.ContainerServiceOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is None. + :param base_url: Service host. Default value is None. :type base_url: str :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2025-10-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2025-10-02-preview" and None. Default value is "2025-10-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. @@ -125,6 +125,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: @@ -133,6 +134,7 @@ def __init__( self._config = ContainerServiceClientConfiguration( credential=credential, subscription_id=subscription_id, + base_url=cast(str, base_url), cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs @@ -157,62 +159,61 @@ def __init__( self._config.http_logging_policy, ] self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( - base_url=cast(str, base_url), policies=_policies, **kwargs + base_url=cast(str, _endpoint), policies=_policies, **kwargs ) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.managed_clusters = ManagedClustersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.container_service = ContainerServiceOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.maintenance_configurations = MaintenanceConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize ) self.managed_namespaces = ManagedNamespacesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize) self.machines = MachinesOperations(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.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize) + self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( + self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.operation_status_result = OperationStatusResultOperations( + self.load_balancers = LoadBalancersOperations(self._client, self._config, self._serialize, self._deserialize) + self.identity_bindings = IdentityBindingsOperations( 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.jwt_authenticators = JWTAuthenticatorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.trusted_access_roles = TrustedAccessRolesOperations( + self.mesh_memberships = MeshMembershipsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations( + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.operation_status_result = OperationStatusResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.load_balancers = LoadBalancersOperations(self._client, self._config, self._serialize, self._deserialize) - self.identity_bindings = IdentityBindingsOperations( + self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.jwt_authenticators = JWTAuthenticatorsOperations( + self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations( self._client, self._config, self._serialize, self._deserialize ) - self.mesh_memberships = MeshMembershipsOperations( + self.trusted_access_roles = TrustedAccessRolesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.container_service = ContainerServiceOperations( self._client, self._config, self._serialize, self._deserialize ) - def _send_request( + def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. @@ -220,7 +221,7 @@ def _send_request( >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = await client._send_request(request) + >>> response = await client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -233,7 +234,11 @@ def _send_request( """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_configuration.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_configuration.py index f0c157741e17..4c71fa48fbc9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_configuration.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -24,15 +24,18 @@ class ContainerServiceClientConfiguration: # pylint: disable=too-many-instance- 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. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2025-10-02-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2025-10-02-preview" and None. Default value is "2025-10-02-preview". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ @@ -40,6 +43,7 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, + base_url: str = "https://management.azure.com", cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: @@ -52,6 +56,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/_patch.py @@ -7,9 +7,9 @@ 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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/__init__.py index 7f09a97cf023..037d985cd842 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,50 +12,50 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import AgentPoolsOperations # type: ignore +from ._operations import ManagedClustersOperations # type: ignore +from ._operations import MaintenanceConfigurationsOperations # type: ignore +from ._operations import ManagedNamespacesOperations # type: ignore +from ._operations import MachinesOperations # type: ignore +from ._operations import PrivateEndpointConnectionsOperations # type: ignore +from ._operations import SnapshotsOperations # type: ignore +from ._operations import ManagedClusterSnapshotsOperations # type: ignore +from ._operations import TrustedAccessRoleBindingsOperations # type: ignore +from ._operations import LoadBalancersOperations # type: ignore +from ._operations import IdentityBindingsOperations # type: ignore +from ._operations import JWTAuthenticatorsOperations # type: ignore +from ._operations import MeshMembershipsOperations # type: ignore from ._operations import Operations # type: ignore -from ._managed_clusters_operations import ManagedClustersOperations # type: ignore -from ._container_service_operations import ContainerServiceOperations # type: ignore -from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations # type: ignore -from ._managed_namespaces_operations import ManagedNamespacesOperations # type: ignore -from ._agent_pools_operations import AgentPoolsOperations # type: ignore -from ._machines_operations import MachinesOperations # type: ignore -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore -from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore -from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations # type: ignore -from ._operation_status_result_operations import OperationStatusResultOperations # type: ignore -from ._snapshots_operations import SnapshotsOperations # type: ignore -from ._managed_cluster_snapshots_operations import ManagedClusterSnapshotsOperations # type: ignore -from ._trusted_access_roles_operations import TrustedAccessRolesOperations # type: ignore -from ._trusted_access_role_bindings_operations import TrustedAccessRoleBindingsOperations # type: ignore -from ._load_balancers_operations import LoadBalancersOperations # type: ignore -from ._identity_bindings_operations import IdentityBindingsOperations # type: ignore -from ._jwt_authenticators_operations import JWTAuthenticatorsOperations # type: ignore -from ._mesh_memberships_operations import MeshMembershipsOperations # type: ignore +from ._operations import OperationStatusResultOperations # type: ignore +from ._operations import PrivateLinkResourcesOperations # type: ignore +from ._operations import ResolvePrivateLinkServiceIdOperations # type: ignore +from ._operations import TrustedAccessRolesOperations # type: ignore +from ._operations import ContainerServiceOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "Operations", + "AgentPoolsOperations", "ManagedClustersOperations", - "ContainerServiceOperations", "MaintenanceConfigurationsOperations", "ManagedNamespacesOperations", - "AgentPoolsOperations", "MachinesOperations", "PrivateEndpointConnectionsOperations", - "PrivateLinkResourcesOperations", - "ResolvePrivateLinkServiceIdOperations", - "OperationStatusResultOperations", "SnapshotsOperations", "ManagedClusterSnapshotsOperations", - "TrustedAccessRolesOperations", "TrustedAccessRoleBindingsOperations", "LoadBalancersOperations", "IdentityBindingsOperations", "JWTAuthenticatorsOperations", "MeshMembershipsOperations", + "Operations", + "OperationStatusResultOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "TrustedAccessRolesOperations", + "ContainerServiceOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_agent_pools_operations.py deleted file mode 100644 index 0bd284cbdb05..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_agent_pools_operations.py +++ /dev/null @@ -1,1338 +0,0 @@ -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._agent_pools_operations import ( - build_abort_latest_operation_request, - build_complete_upgrade_request, - build_create_or_update_request, - build_delete_machines_request, - build_delete_request, - build_get_available_agent_pool_versions_request, - build_get_request, - build_get_upgrade_profile_request, - build_list_request, - build_upgrade_node_image_version_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class AgentPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`agent_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _abort_latest_operation_initial( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_abort_latest_operation_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_abort_latest_operation( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Aborts last operation running on agent pool. - - Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a - Canceling state and eventually to a Canceled state when cancellation finishes. If the operation - completes before cancellation can take place, an error is returned. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._abort_latest_operation_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncItemPaged["_models.AgentPool"]: - """Gets a list of agent pools in the specified managed cluster. - - Gets a list of agent pools in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either AgentPool or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AgentPoolListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> _models.AgentPool: - """Gets the specified managed cluster agent pool. - - Gets the specified managed cluster agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: AgentPool or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.AgentPool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AgentPool", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - parameters: Union[_models.AgentPool, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "AgentPool") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - parameters: _models.AgentPool, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AgentPool]: - """Creates or updates an agent pool in the specified managed cluster. - - Creates or updates an agent pool in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param parameters: The agent pool to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.AgentPool - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either AgentPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - parameters: IO[bytes], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.AgentPool]: - """Creates or updates an agent pool in the specified managed cluster. - - Creates or updates an agent pool in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param parameters: The agent pool to create or update. Required. - :type parameters: IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either AgentPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - parameters: Union[_models.AgentPool, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.AgentPool]: - """Creates or updates an agent pool in the specified managed cluster. - - Creates or updates an agent pool in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param parameters: The agent pool to create or update. Is either a AgentPool type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.AgentPool or IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :return: An instance of AsyncLROPoller that returns either AgentPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - parameters=parameters, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AgentPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AgentPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AgentPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - ignore_pod_disruption_budget: Optional[bool] = None, - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - ignore_pod_disruption_budget=ignore_pod_disruption_budget, - if_match=if_match, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - ignore_pod_disruption_budget: Optional[bool] = None, - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an agent pool in the specified managed cluster. - - Deletes an agent pool in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on - a node without considering Pod Disruption Budget. Default value is None. - :type ignore_pod_disruption_budget: bool - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - ignore_pod_disruption_budget=ignore_pod_disruption_budget, - if_match=if_match, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def get_upgrade_profile( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> _models.AgentPoolUpgradeProfile: - """Gets the upgrade profile for an agent pool. - - Gets the upgrade profile for an agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: AgentPoolUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.AgentPoolUpgradeProfile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) - - _request = build_get_upgrade_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AgentPoolUpgradeProfile", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _complete_upgrade_initial( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_complete_upgrade_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_complete_upgrade( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Completes the upgrade of an agent pool. - - Completes the upgrade operation for the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._complete_upgrade_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _delete_machines_initial( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(machines, (IOBase, bytes)): - _content = machines - else: - _json = self._serialize.body(machines, "AgentPoolDeleteMachinesParameter") - - _request = build_delete_machines_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_delete_machines( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machines: _models.AgentPoolDeleteMachinesParameter, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specific machines in an agent pool. - - Deletes specific machines in an agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machines: A list of machines from the agent pool to be deleted. Required. - :type machines: ~azure.mgmt.containerservice.models.AgentPoolDeleteMachinesParameter - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_delete_machines( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machines: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specific machines in an agent pool. - - Deletes specific machines in an agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machines: A list of machines from the agent pool to be deleted. Required. - :type machines: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_delete_machines( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes specific machines in an agent pool. - - Deletes specific machines in an agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machines: A list of machines from the agent pool to be deleted. Is either a - AgentPoolDeleteMachinesParameter type or a IO[bytes] type. Required. - :type machines: ~azure.mgmt.containerservice.models.AgentPoolDeleteMachinesParameter or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_machines_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - machines=machines, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def get_available_agent_pool_versions( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> _models.AgentPoolAvailableVersions: - """Gets a list of supported Kubernetes versions for the specified agent pool. - - See `supported Kubernetes versions - `_ for more details about - the version lifecycle. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: AgentPoolAvailableVersions or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.AgentPoolAvailableVersions - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) - - _request = build_get_available_agent_pool_versions_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AgentPoolAvailableVersions", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _upgrade_node_image_version_initial( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_upgrade_node_image_version_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_upgrade_node_image_version( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.AgentPool]: - """Upgrades the node image version of an agent pool to the latest. - - Upgrading the node image version of an agent pool applies the newest OS and runtime updates to - the nodes. AKS provides one new image per week with the latest updates. For more details on - node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: An instance of AsyncLROPoller that returns either AgentPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._upgrade_node_image_version_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - 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.http_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.AgentPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.AgentPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_container_service_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_container_service_operations.py deleted file mode 100644 index 64cd46b96d71..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_container_service_operations.py +++ /dev/null @@ -1,141 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._container_service_operations import build_list_node_image_versions_request -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ContainerServiceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`container_service` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_node_image_versions(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.NodeImageVersion"]: - """Gets a list of supported NodeImage versions in the specified subscription. - - Only returns the latest version of each node image. For example there may be an - AKSUbuntu-1804gen2containerd-2024.01.26, but only AKSUbuntu-1804gen2containerd-2024.02.02 is - visible in this list. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either NodeImageVersion or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.NodeImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NodeImageVersionsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_node_image_versions_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NodeImageVersionsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_identity_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_identity_bindings_operations.py deleted file mode 100644 index 31f0265ad7c7..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_identity_bindings_operations.py +++ /dev/null @@ -1,580 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._identity_bindings_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_managed_cluster_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class IdentityBindingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`identity_bindings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.IdentityBinding"]: - """Gets a list of identity bindings in the specified managed cluster. - - Gets a list of identity bindings in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either IdentityBinding or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.IdentityBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IdentityBindingListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("IdentityBindingListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any - ) -> _models.IdentityBinding: - """Gets the specified Identity Binding. - - Gets the specified Identity 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 identity_binding_name: The name of the identity binding. Required. - :type identity_binding_name: str - :return: IdentityBinding or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.IdentityBinding - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IdentityBinding] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - identity_binding_name=identity_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("IdentityBinding", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - identity_binding_name: str, - parameters: Union[_models.IdentityBinding, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "IdentityBinding") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - identity_binding_name=identity_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - identity_binding_name: str, - parameters: _models.IdentityBinding, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IdentityBinding]: - """Creates or updates an identity binding in the specified managed cluster. - - Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. - :type identity_binding_name: str - :param parameters: The identity binding to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.IdentityBinding - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either IdentityBinding or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.IdentityBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - identity_binding_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.IdentityBinding]: - """Creates or updates an identity binding in the specified managed cluster. - - Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. - :type identity_binding_name: str - :param parameters: The identity binding to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either IdentityBinding or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.IdentityBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - identity_binding_name: str, - parameters: Union[_models.IdentityBinding, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.IdentityBinding]: - """Creates or updates an identity binding in the specified managed cluster. - - Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. - :type identity_binding_name: str - :param parameters: The identity binding to create or update. Is either a IdentityBinding type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.IdentityBinding or IO[bytes] - :return: An instance of AsyncLROPoller that returns either IdentityBinding or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.IdentityBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IdentityBinding] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - identity_binding_name=identity_binding_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("IdentityBinding", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.IdentityBinding].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.IdentityBinding]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - identity_binding_name=identity_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if response.status_code == 204: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an identity binding in the specified managed cluster. - - Deletes an identity binding 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 identity_binding_name: The name of the identity binding. Required. - :type identity_binding_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - identity_binding_name=identity_binding_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_jwt_authenticators_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_jwt_authenticators_operations.py deleted file mode 100644 index a8b24d0069b3..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_jwt_authenticators_operations.py +++ /dev/null @@ -1,587 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._jwt_authenticators_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_managed_cluster_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JWTAuthenticatorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`jwt_authenticators` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.JWTAuthenticator"]: - """Gets a list of JWT authenticators in the specified managed cluster. - - Gets a list of JWT authenticators in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either JWTAuthenticator or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.JWTAuthenticator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JWTAuthenticatorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JWTAuthenticatorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any - ) -> _models.JWTAuthenticator: - """Gets the specified JWT authenticator of a managed cluster. - - Gets the specified JWT authenticator 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 jwt_authenticator_name: The name of the JWT authenticator. Required. - :type jwt_authenticator_name: str - :return: JWTAuthenticator or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.JWTAuthenticator - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JWTAuthenticator] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - jwt_authenticator_name=jwt_authenticator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JWTAuthenticator", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - jwt_authenticator_name: str, - parameters: Union[_models.JWTAuthenticator, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "JWTAuthenticator") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - jwt_authenticator_name=jwt_authenticator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - jwt_authenticator_name: str, - parameters: _models.JWTAuthenticator, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JWTAuthenticator]: - """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param jwt_authenticator_name: The name of the JWT authenticator. Required. - :type jwt_authenticator_name: str - :param parameters: The JWT authenticator to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.JWTAuthenticator - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either JWTAuthenticator or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - jwt_authenticator_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JWTAuthenticator]: - """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param jwt_authenticator_name: The name of the JWT authenticator. Required. - :type jwt_authenticator_name: str - :param parameters: The JWT authenticator to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either JWTAuthenticator or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - jwt_authenticator_name: str, - parameters: Union[_models.JWTAuthenticator, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.JWTAuthenticator]: - """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param jwt_authenticator_name: The name of the JWT authenticator. Required. - :type jwt_authenticator_name: str - :param parameters: The JWT authenticator to create or update. Is either a JWTAuthenticator type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.JWTAuthenticator or IO[bytes] - :return: An instance of AsyncLROPoller that returns either JWTAuthenticator or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JWTAuthenticator] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - jwt_authenticator_name=jwt_authenticator_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("JWTAuthenticator", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.JWTAuthenticator].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JWTAuthenticator]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - jwt_authenticator_name=jwt_authenticator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if response.status_code == 204: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a JWT authenticator and updates the managed cluster to apply the settings. - - Deletes a JWT authenticator and updates the managed cluster to apply the settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param jwt_authenticator_name: The name of the JWT authenticator. Required. - :type jwt_authenticator_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - jwt_authenticator_name=jwt_authenticator_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_load_balancers_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_load_balancers_operations.py deleted file mode 100644 index 220e0717c8e5..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_load_balancers_operations.py +++ /dev/null @@ -1,499 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._load_balancers_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_managed_cluster_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class LoadBalancersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`load_balancers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.LoadBalancer"]: - """Gets a list of load balancers in the specified managed cluster. - - Gets a list of load balancers in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either LoadBalancer or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.LoadBalancer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LoadBalancerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any - ) -> _models.LoadBalancer: - """Gets the specified load balancer. - - Gets the specified load balancer. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param load_balancer_name: The name of the load balancer. Required. - :type load_balancer_name: str - :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.LoadBalancer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - load_balancer_name=load_balancer_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("LoadBalancer", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - load_balancer_name: str, - parameters: _models.LoadBalancer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LoadBalancer: - """Creates or updates a load balancer in the specified managed cluster. - - Creates or updates a load balancer in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param load_balancer_name: The name of the load balancer. Required. - :type load_balancer_name: str - :param parameters: The load balancer to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.LoadBalancer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.LoadBalancer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - load_balancer_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LoadBalancer: - """Creates or updates a load balancer in the specified managed cluster. - - Creates or updates a load balancer in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param load_balancer_name: The name of the load balancer. Required. - :type load_balancer_name: str - :param parameters: The load balancer to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.LoadBalancer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - load_balancer_name: str, - parameters: Union[_models.LoadBalancer, IO[bytes]], - **kwargs: Any - ) -> _models.LoadBalancer: - """Creates or updates a load balancer in the specified managed cluster. - - Creates or updates a load balancer in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param load_balancer_name: The name of the load balancer. Required. - :type load_balancer_name: str - :param parameters: The load balancer to create or update. Is either a LoadBalancer type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.LoadBalancer or IO[bytes] - :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.LoadBalancer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "LoadBalancer") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - load_balancer_name=load_balancer_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("LoadBalancer", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - load_balancer_name=load_balancer_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if response.status_code == 204: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a load balancer in the specified managed cluster. - - Deletes a load balancer in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param load_balancer_name: The name of the load balancer. Required. - :type load_balancer_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - load_balancer_name=load_balancer_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_machines_operations.py deleted file mode 100644 index 2ee23142b674..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_machines_operations.py +++ /dev/null @@ -1,489 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._machines_operations import build_create_or_update_request, build_get_request, build_list_request -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class MachinesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`machines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Machine"]: - """Gets a list of machines in the specified agent pool. - - Gets a list of machines in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: An iterator like instance of either Machine or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.Machine] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MachineListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, machine_name: str, **kwargs: Any - ) -> _models.Machine: - """Get a specific machine in the specified agent pool. - - Get a specific machine in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machine_name: Host name of the machine. Required. - :type machine_name: str - :return: Machine or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Machine - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Machine] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - machine_name=machine_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Machine", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machine_name: str, - parameters: Union[_models.Machine, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Machine") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - machine_name=machine_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machine_name: str, - parameters: _models.Machine, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Machine]: - """Creates or updates a machine in the specified agent pool. - - Creates or updates a machine in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machine_name: Host name of the machine. Required. - :type machine_name: str - :param parameters: The machine to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.Machine - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Machine or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.Machine] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machine_name: str, - parameters: IO[bytes], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Machine]: - """Creates or updates a machine in the specified agent pool. - - Creates or updates a machine in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machine_name: Host name of the machine. Required. - :type machine_name: str - :param parameters: The machine to create or update. Required. - :type parameters: IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either Machine or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.Machine] - :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, - machine_name: str, - parameters: Union[_models.Machine, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.Machine]: - """Creates or updates a machine in the specified agent pool. - - Creates or updates a machine in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machine_name: Host name of the machine. Required. - :type machine_name: str - :param parameters: The machine to create or update. Is either a Machine type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.containerservice.models.Machine or IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :return: An instance of AsyncLROPoller that returns either Machine or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.Machine] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Machine] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - machine_name=machine_name, - parameters=parameters, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - 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("Machine", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Machine].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Machine]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_maintenance_configurations_operations.py deleted file mode 100644 index e11d52fc87fa..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_maintenance_configurations_operations.py +++ /dev/null @@ -1,434 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._maintenance_configurations_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_managed_cluster_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class MaintenanceConfigurationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`maintenance_configurations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.MaintenanceConfiguration"]: - """Gets a list of maintenance configurations in the specified managed cluster. - - Gets a list of maintenance configurations in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either MaintenanceConfiguration or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.MaintenanceConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, 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. Supported values are 'default', - 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. - :type config_name: str - :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - config_name=config_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - config_name: str, - parameters: _models.MaintenanceConfiguration, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.MaintenanceConfiguration: - """Creates or updates a maintenance configuration in the specified managed cluster. - - Creates or updates a maintenance configuration in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param config_name: The name of the maintenance configuration. Supported values are 'default', - 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. - :type config_name: str - :param parameters: The maintenance configuration to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.MaintenanceConfiguration - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - config_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.MaintenanceConfiguration: - """Creates or updates a maintenance configuration in the specified managed cluster. - - Creates or updates a maintenance configuration in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param config_name: The name of the maintenance configuration. Supported values are 'default', - 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. - :type config_name: str - :param parameters: The maintenance configuration to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - config_name: str, - parameters: Union[_models.MaintenanceConfiguration, IO[bytes]], - **kwargs: Any - ) -> _models.MaintenanceConfiguration: - """Creates or updates a maintenance configuration in the specified managed cluster. - - Creates or updates a maintenance configuration in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param config_name: The name of the maintenance configuration. Supported values are 'default', - 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. - :type config_name: str - :param parameters: The maintenance configuration to create or update. Is either a - MaintenanceConfiguration type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.MaintenanceConfiguration or IO[bytes] - :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "MaintenanceConfiguration") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - config_name=config_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(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. Supported values are 'default', - 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. - :type config_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - config_name=config_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_managed_cluster_snapshots_operations.py deleted file mode 100644 index 8ccf0d7a4c62..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_managed_cluster_snapshots_operations.py +++ /dev/null @@ -1,634 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._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, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedClusterSnapshotsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`managed_cluster_snapshots` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.ManagedClusterSnapshot"]: - """Gets a list of managed cluster snapshots in the specified subscription. - - Gets a list of managed cluster snapshots in the specified subscription. - - :return: An iterator like instance of either ManagedClusterSnapshot or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.ManagedClusterSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedClusterSnapshotListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedClusterSnapshot"]: - """Lists managed cluster snapshots in the specified subscription and resource group. - - Lists managed cluster snapshots in the specified subscription and resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either ManagedClusterSnapshot or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.ManagedClusterSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedClusterSnapshotListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedClusterSnapshot: - """Gets a managed cluster snapshot. - - Gets a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.ManagedClusterSnapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Creates or updates a managed cluster snapshot. - - Creates or updates a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster snapshot to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Creates or updates a managed cluster snapshot. - - Creates or updates a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster snapshot to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedClusterSnapshot, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Creates or updates a managed cluster snapshot. - - Creates or updates a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster snapshot to create or update. Is either a - ManagedClusterSnapshot type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot or IO[bytes] - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedClusterSnapshot") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.TagsObject, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Updates tags on a managed cluster snapshot. - - Updates tags on a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. - Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Updates tags on a managed cluster snapshot. - - Updates tags on a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. - Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Updates tags on a managed cluster snapshot. - - Updates tags on a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. - Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject or IO[bytes] - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TagsObject") - - _request = build_update_tags_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> None: - """Deletes a managed cluster snapshot. - - Deletes a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_managed_clusters_operations.py deleted file mode 100644 index a8f9eb56795c..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_managed_clusters_operations.py +++ /dev/null @@ -1,3494 +0,0 @@ -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_clusters_operations import ( - build_abort_latest_operation_request, - build_create_or_update_request, - build_delete_request, - build_get_access_profile_request, - build_get_command_result_request, - build_get_guardrails_versions_request, - build_get_mesh_revision_profile_request, - build_get_mesh_upgrade_profile_request, - build_get_request, - build_get_safeguards_versions_request, - build_get_upgrade_profile_request, - build_list_by_resource_group_request, - build_list_cluster_admin_credentials_request, - build_list_cluster_monitoring_user_credentials_request, - build_list_cluster_user_credentials_request, - build_list_guardrails_versions_request, - build_list_kubernetes_versions_request, - build_list_mesh_revision_profiles_request, - build_list_mesh_upgrade_profiles_request, - build_list_outbound_network_dependencies_endpoints_request, - build_list_request, - build_list_safeguards_versions_request, - build_rebalance_load_balancers_request, - build_reset_aad_profile_request, - build_reset_service_principal_profile_request, - build_rotate_cluster_certificates_request, - build_rotate_service_account_signing_keys_request, - build_run_command_request, - build_start_request, - build_stop_request, - build_update_tags_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -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.aio.ContainerServiceClient`'s - :attr:`managed_clusters` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.KubernetesVersionListResult: - """Gets a list of supported Kubernetes versions in the specified subscription. - - Contains extra metadata on the version, including supported patch versions, capabilities, - available upgrades, and details on preview status of the version. - - :param location: The name of the Azure region. Required. - :type location: str - :return: KubernetesVersionListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.KubernetesVersionListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) - - _request = build_list_kubernetes_versions_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("KubernetesVersionListResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.ManagedCluster"]: - """Gets a list of managed clusters in the specified subscription. - - Gets a list of managed clusters in the specified subscription. - - :return: An iterator like instance of either ManagedCluster or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedCluster"]: - """Lists managed clusters in the specified subscription and resource group. - - Lists managed clusters in the specified subscription and resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either ManagedCluster or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_upgrade_profile( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> _models.ManagedClusterUpgradeProfile: - """Gets the upgrade profile of a managed cluster. - - Gets the upgrade profile of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: ManagedClusterUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterUpgradeProfile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) - - _request = build_get_upgrade_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedClusterUpgradeProfile", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_access_profile( - self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any - ) -> _models.ManagedClusterAccessProfile: - """Gets an access profile of a managed cluster. - - **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials - `_ or - `ListClusterAdminCredentials - `_ . - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param role_name: The name of the role for managed cluster accessProfile resource. Required. - :type role_name: str - :return: ManagedClusterAccessProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterAccessProfile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) - - _request = build_get_access_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - role_name=role_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedClusterAccessProfile", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_cluster_admin_credentials( - self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any - ) -> _models.CredentialResults: - """Lists the admin credentials of a managed cluster. - - Lists the admin credentials of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. - :type server_fqdn: str - :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.CredentialResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) - - _request = build_list_cluster_admin_credentials_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - server_fqdn=server_fqdn, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CredentialResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_cluster_user_credentials( - self, - resource_group_name: str, - resource_name: str, - server_fqdn: Optional[str] = None, - format: Optional[Union[str, _models.Format]] = None, - **kwargs: Any - ) -> _models.CredentialResults: - """Lists the user credentials of a managed cluster. - - Lists the user credentials of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. - :type server_fqdn: str - :param format: Only apply to AAD clusters, specifies the format of returned kubeconfig. Format - 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format - kubeconfig, which requires kubelogin binary in the path. Known values are: "azure", "exec", and - "exec". Default value is None. - :type format: str or ~azure.mgmt.containerservice.models.Format - :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.CredentialResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) - - _request = build_list_cluster_user_credentials_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - server_fqdn=server_fqdn, - format=format, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CredentialResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_cluster_monitoring_user_credentials( - self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any - ) -> _models.CredentialResults: - """Lists the cluster monitoring user credentials of a managed cluster. - - Lists the cluster monitoring user credentials of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. - :type server_fqdn: str - :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.CredentialResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) - - _request = build_list_cluster_monitoring_user_credentials_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - server_fqdn=server_fqdn, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CredentialResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: - """Gets a managed cluster. - - Gets a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: ManagedCluster or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedCluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedCluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedCluster, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedCluster") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.ManagedCluster, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedCluster]: - """Creates or updates a managed cluster. - - Creates or updates a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedCluster - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedCluster]: - """Creates or updates a managed cluster. - - Creates or updates a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster to create or update. Required. - :type parameters: IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedCluster, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedCluster]: - """Creates or updates a managed cluster. - - Creates or updates a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster to create or update. Is either a ManagedCluster type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedCluster or IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedCluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ManagedCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_tags_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TagsObject") - - _request = build_update_tags_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.TagsObject, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedCluster]: - """Updates tags on a managed cluster. - - Updates tags on a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedCluster]: - """Updates tags on a managed cluster. - - Updates tags on a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. - :type parameters: IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedCluster]: - """Updates tags on a managed cluster. - - Updates tags on a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Is either - a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject or IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :return: An instance of AsyncLROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - if_match=if_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedCluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ManagedCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - resource_name: str, - if_match: Optional[str] = None, - ignore_pod_disruption_budget: Optional[bool] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - ignore_pod_disruption_budget=ignore_pod_disruption_budget, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - resource_name: str, - if_match: Optional[str] = None, - 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 if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on - a node without considering Pod Disruption Budget. Default value is None. - :type ignore_pod_disruption_budget: bool - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - if_match=if_match, - ignore_pod_disruption_budget=ignore_pod_disruption_budget, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _reset_service_principal_profile_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedClusterServicePrincipalProfile") - - _request = build_reset_service_principal_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @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.models.ManagedClusterServicePrincipalProfile - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_reset_service_principal_profile( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Reset the Service Principal Profile of a managed cluster. - - This action cannot be performed on a cluster that is not using a service principal. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The service principal profile to set on the managed cluster. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_reset_service_principal_profile( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Reset the Service Principal Profile of a managed cluster. - - This action cannot be performed on a cluster that is not using a service principal. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The service principal profile to set on the managed cluster. Is either a - ManagedClusterServicePrincipalProfile type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterServicePrincipalProfile or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._reset_service_principal_profile_initial( - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _reset_aad_profile_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedClusterAADProfile") - - _request = build_reset_aad_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_reset_aad_profile( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.ManagedClusterAADProfile, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Reset the AAD Profile of a managed cluster. - - **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory - integration `_ to update your cluster with AKS-managed Azure - AD. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The AAD profile to set on the Managed Cluster. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_reset_aad_profile( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Reset the AAD Profile of a managed cluster. - - **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory - integration `_ to update your cluster with AKS-managed Azure - AD. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The AAD profile to set on the Managed Cluster. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_reset_aad_profile( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Reset the AAD Profile of a managed cluster. - - **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory - integration `_ to update your cluster with AKS-managed Azure - AD. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The AAD profile to set on the Managed Cluster. Is either a - ManagedClusterAADProfile type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile or IO[bytes] - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._reset_aad_profile_initial( - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _abort_latest_operation_initial( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_abort_latest_operation_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_abort_latest_operation( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Aborts last operation running on managed cluster. - - Aborts the currently running operation on the managed cluster. The Managed Cluster will be - moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If - the operation completes before cancellation can take place, an error is returned. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._abort_latest_operation_initial( - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _rotate_cluster_certificates_initial( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_rotate_cluster_certificates_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_rotate_cluster_certificates( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Rotates the certificates of a managed cluster. - - See `Certificate rotation `_ for - more details about rotating managed cluster certificates. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._rotate_cluster_certificates_initial( - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _rotate_service_account_signing_keys_initial( # pylint: disable=name-too-long - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_rotate_service_account_signing_keys_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Rotates the service account signing keys of a managed cluster. - - Rotates the service account signing keys of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._rotate_service_account_signing_keys_initial( - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _stop_initial(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_stop_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Stops a Managed Cluster. - - This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a - cluster stops the control plane and agent nodes entirely, while maintaining all object and - cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster - `_ for more details about stopping a - cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._stop_initial( - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _start_initial(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_start_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Starts a previously stopped Managed Cluster. - - See `starting a cluster `_ for more - details about starting a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._start_initial( - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _run_command_initial( - self, - resource_group_name: str, - resource_name: str, - request_payload: Union[_models.RunCommandRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(request_payload, (IOBase, bytes)): - _content = request_payload - else: - _json = self._serialize.body(request_payload, "RunCommandRequest") - - _request = build_run_command_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @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.models.RunCommandRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_run_command( - self, - resource_group_name: str, - resource_name: str, - request_payload: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RunCommandResult]: - """Submits a command to run against the Managed Cluster. - - AKS will create a pod to run the command. This is primarily useful for private clusters. For - more information see `AKS Run Command - `_. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param request_payload: The run command request. Required. - :type request_payload: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_run_command( - self, - resource_group_name: str, - resource_name: str, - request_payload: Union[_models.RunCommandRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.RunCommandResult]: - """Submits a command to run against the Managed Cluster. - - AKS will create a pod to run the command. This is primarily useful for private clusters. For - more information see `AKS Run Command - `_. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param request_payload: The run command request. Is either a RunCommandRequest type or a - IO[bytes] type. Required. - :type request_payload: ~azure.mgmt.containerservice.models.RunCommandRequest or IO[bytes] - :return: An instance of AsyncLROPoller that returns either RunCommandResult or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RunCommandResult] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._run_command_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - request_payload=request_payload, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("RunCommandResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.RunCommandResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.RunCommandResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get_command_result( - self, resource_group_name: str, resource_name: str, command_id: str, **kwargs: Any - ) -> Optional[_models.RunCommandResult]: - """Gets the results of a command which has been run on the Managed Cluster. - - Gets the results of a command which has been run on the Managed Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param command_id: Id of the command. Required. - :type command_id: str - :return: RunCommandResult or None or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.RunCommandResult or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) - - _request = build_get_command_result_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - command_id=command_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("RunCommandResult", pipeline_response.http_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.OutboundEnvironmentEndpoint"]: - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the - specified managed cluster. - - Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the - specified managed cluster. The operation returns properties of each egress endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either OutboundEnvironmentEndpoint or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.OutboundEnvironmentEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_outbound_network_dependencies_endpoints_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_guardrails_versions( - self, location: str, version: str, **kwargs: Any - ) -> _models.GuardrailsAvailableVersion: - """Gets supported Guardrails version in the specified subscription and location. - - Contains Guardrails version along with its support info and whether it is a default version. - - :param location: The name of the Azure region. Required. - :type location: str - :param version: Safeguards version. Required. - :type version: str - :return: GuardrailsAvailableVersion or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.GuardrailsAvailableVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) - - _request = build_get_guardrails_versions_request( - location=location, - version=version, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GuardrailsAvailableVersion", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_guardrails_versions( - self, location: str, **kwargs: Any - ) -> AsyncItemPaged["_models.GuardrailsAvailableVersion"]: - """Gets a list of supported Guardrails versions in the specified subscription and location. - - Contains list of Guardrails version along with its support info and whether it is a default - version. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either GuardrailsAvailableVersion or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.GuardrailsAvailableVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_guardrails_versions_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GuardrailsAvailableVersionsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_safeguards_versions( - self, location: str, version: str, **kwargs: Any - ) -> _models.SafeguardsAvailableVersion: - """Gets supported Safeguards version in the specified subscription and location. - - Contains Safeguards version along with its support info and whether it is a default version. - - :param location: The name of the Azure region. Required. - :type location: str - :param version: Safeguards version. Required. - :type version: str - :return: SafeguardsAvailableVersion or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.SafeguardsAvailableVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) - - _request = build_get_safeguards_versions_request( - location=location, - version=version, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SafeguardsAvailableVersion", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_safeguards_versions( - self, location: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SafeguardsAvailableVersion"]: - """Gets a list of supported Safeguards versions in the specified subscription and location. - - Contains list of Safeguards version along with its support info and whether it is a default - version. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either SafeguardsAvailableVersion or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.SafeguardsAvailableVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_safeguards_versions_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SafeguardsAvailableVersionsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_mesh_revision_profiles( - self, location: str, **kwargs: Any - ) -> AsyncItemPaged["_models.MeshRevisionProfile"]: - """Lists mesh revision profiles for all meshes in the specified location. - - Contains extra metadata on each revision, including supported revisions, cluster compatibility - and available upgrades. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either MeshRevisionProfile or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.MeshRevisionProfile] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_mesh_revision_profiles_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MeshRevisionProfileList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _models.MeshRevisionProfile: - """Gets a mesh revision profile for a specified mesh in the specified location. - - Contains extra metadata on the revision, including supported revisions, cluster compatibility - and available upgrades. - - :param location: The name of the Azure region. Required. - :type location: str - :param mode: The mode of the mesh. Required. - :type mode: str - :return: MeshRevisionProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MeshRevisionProfile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) - - _request = build_get_mesh_revision_profile_request( - location=location, - mode=mode, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MeshRevisionProfile", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_mesh_upgrade_profiles( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.MeshUpgradeProfile"]: - """Lists available upgrades for all service meshes in a specific cluster. - - Lists available upgrades for all service meshes in a specific cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either MeshUpgradeProfile or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.MeshUpgradeProfile] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_mesh_upgrade_profiles_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MeshUpgradeProfileList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_mesh_upgrade_profile( - self, resource_group_name: str, resource_name: str, mode: str, **kwargs: Any - ) -> _models.MeshUpgradeProfile: - """Gets available upgrades for a service mesh in a cluster. - - Gets available upgrades for a service mesh in a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param mode: The mode of the mesh. Required. - :type mode: str - :return: MeshUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MeshUpgradeProfile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) - - _request = build_get_mesh_upgrade_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - mode=mode, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MeshUpgradeProfile", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _rebalance_load_balancers_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "RebalanceLoadBalancersRequestBody") - - _request = build_rebalance_load_balancers_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_rebalance_load_balancers( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.RebalanceLoadBalancersRequestBody, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Rebalance nodes across specific load balancers. - - Rebalance nodes across specific load balancers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load - balancers will be rebalanced. Required. - :type parameters: ~azure.mgmt.containerservice.models.RebalanceLoadBalancersRequestBody - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_rebalance_load_balancers( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Rebalance nodes across specific load balancers. - - Rebalance nodes across specific load balancers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load - balancers will be rebalanced. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_rebalance_load_balancers( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Rebalance nodes across specific load balancers. - - Rebalance nodes across specific load balancers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load - balancers will be rebalanced. Is either a RebalanceLoadBalancersRequestBody type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.containerservice.models.RebalanceLoadBalancersRequestBody or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._rebalance_load_balancers_initial( - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_managed_namespaces_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_managed_namespaces_operations.py deleted file mode 100644 index ecd1869246e1..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_managed_namespaces_operations.py +++ /dev/null @@ -1,809 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_namespaces_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_managed_cluster_request, - build_list_credential_request, - build_update_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedNamespacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`managed_namespaces` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedNamespace"]: - """Gets a list of managed namespaces in the specified managed cluster. - - Gets a list of managed namespaces in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either ManagedNamespace or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.ManagedNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedNamespaceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedNamespaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any - ) -> _models.ManagedNamespace: - """Gets the specified namespace of a managed cluster. - - Gets the specified namespace of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :return: ManagedNamespace or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedNamespace", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: Union[_models.ManagedNamespace, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedNamespace") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: _models.ManagedNamespace, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNamespace]: - """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: The namespace to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedNamespace - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ManagedNamespace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNamespace]: - """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: The namespace to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ManagedNamespace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: Union[_models.ManagedNamespace, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedNamespace]: - """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: The namespace to create or update. Is either a ManagedNamespace type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedNamespace or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedNamespace or the result of - cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("ManagedNamespace", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ManagedNamespace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedNamespace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if response.status_code == 204: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a namespace. - - Deletes a namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: _models.TagsObject, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedNamespace: - """Updates tags on a managed namespace. - - Updates tags on a managed namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: Parameters supplied to the patch namespace operation, we only support patch - tags for now. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedNamespace or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedNamespace: - """Updates tags on a managed namespace. - - Updates tags on a managed namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: Parameters supplied to the patch namespace operation, we only support patch - tags for now. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedNamespace or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: Union[_models.TagsObject, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedNamespace: - """Updates tags on a managed namespace. - - Updates tags on a managed namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: Parameters supplied to the patch namespace operation, we only support patch - tags for now. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject or IO[bytes] - :return: ManagedNamespace or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TagsObject") - - _request = build_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedNamespace", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def list_credential( - self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any - ) -> _models.CredentialResults: - """Lists the credentials of a namespace. - - Lists the credentials of a namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.CredentialResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) - - _request = build_list_credential_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CredentialResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_mesh_memberships_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_mesh_memberships_operations.py deleted file mode 100644 index a68288901ca9..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_mesh_memberships_operations.py +++ /dev/null @@ -1,555 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._mesh_memberships_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_managed_cluster_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class MeshMembershipsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`mesh_memberships` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.MeshMembership"]: - """Lists mesh memberships in a managed cluster. - - Lists mesh memberships in a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either MeshMembership or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.MeshMembership] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshMembershipsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MeshMembershipsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any - ) -> _models.MeshMembership: - """Gets the mesh membership of a managed cluster. - - Gets the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. - :type mesh_membership_name: str - :return: MeshMembership or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MeshMembership - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshMembership] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - mesh_membership_name=mesh_membership_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MeshMembership", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - mesh_membership_name: str, - parameters: Union[_models.MeshMembership, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "MeshMembership") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - mesh_membership_name=mesh_membership_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - mesh_membership_name: str, - parameters: _models.MeshMembership, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MeshMembership]: - """Creates or updates the mesh membership of a managed cluster. - - Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. - :type mesh_membership_name: str - :param parameters: The mesh membership to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.MeshMembership - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either MeshMembership or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.MeshMembership] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - mesh_membership_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MeshMembership]: - """Creates or updates the mesh membership of a managed cluster. - - Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. - :type mesh_membership_name: str - :param parameters: The mesh membership to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either MeshMembership or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.MeshMembership] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - mesh_membership_name: str, - parameters: Union[_models.MeshMembership, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.MeshMembership]: - """Creates or updates the mesh membership of a managed cluster. - - Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. - :type mesh_membership_name: str - :param parameters: The mesh membership to create or update. Is either a MeshMembership type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.MeshMembership or IO[bytes] - :return: An instance of AsyncLROPoller that returns either MeshMembership or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.MeshMembership] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MeshMembership] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - mesh_membership_name=mesh_membership_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("MeshMembership", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.MeshMembership].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.MeshMembership]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - mesh_membership_name=mesh_membership_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the mesh membership of a managed cluster. - - Deletes the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. - :type mesh_membership_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - mesh_membership_name=mesh_membership_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_operation_status_result_operations.py deleted file mode 100644 index 8a0e67f542dd..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_operation_status_result_operations.py +++ /dev/null @@ -1,286 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._operation_status_result_operations import ( - build_get_by_agent_pool_request, - build_get_request, - build_list_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class OperationStatusResultOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`operation_status_result` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.OperationStatusResult"]: - """Gets a list of operations in the specified managedCluster. - - Gets a list of operations in the specified managedCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either OperationStatusResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationStatusResultList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, resource_name: str, operation_id: str, **kwargs: Any - ) -> _models.OperationStatusResult: - """Get the status of a specific operation in the specified managed cluster. - - Get the status of a specific operation in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param operation_id: The ID of an ongoing async operation. Required. - :type operation_id: str - :return: OperationStatusResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.OperationStatusResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OperationStatusResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get_by_agent_pool( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, operation_id: str, **kwargs: Any - ) -> _models.OperationStatusResult: - """Get the status of a specific operation in the specified agent pool. - - Get the status of a specific operation in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param operation_id: The ID of an ongoing async operation. Required. - :type operation_id: str - :return: OperationStatusResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.OperationStatusResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) - - _request = build_get_by_agent_pool_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OperationStatusResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_operations.py index 6277992c37d3..9c9fd1f0233b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_operations.py @@ -1,52 +1,161 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse -from azure.core import AsyncPipelineClient +from azure.core import AsyncPipelineClient, MatchConditions from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer -from ...operations._operations import build_list_request +from ..._validation import api_version_validation +from ...operations._operations import ( + build_agent_pools_abort_latest_operation_request, + build_agent_pools_complete_upgrade_request, + build_agent_pools_create_or_update_request, + build_agent_pools_delete_machines_request, + build_agent_pools_delete_request, + build_agent_pools_get_available_agent_pool_versions_request, + build_agent_pools_get_request, + build_agent_pools_get_upgrade_profile_request, + build_agent_pools_list_request, + build_agent_pools_upgrade_node_image_version_request, + build_container_service_list_node_image_versions_request, + build_identity_bindings_create_or_update_request, + build_identity_bindings_delete_request, + build_identity_bindings_get_request, + build_identity_bindings_list_by_managed_cluster_request, + build_jwt_authenticators_create_or_update_request, + build_jwt_authenticators_delete_request, + build_jwt_authenticators_get_request, + build_jwt_authenticators_list_by_managed_cluster_request, + build_load_balancers_create_or_update_request, + build_load_balancers_delete_request, + build_load_balancers_get_request, + build_load_balancers_list_by_managed_cluster_request, + build_machines_create_or_update_request, + build_machines_get_request, + build_machines_list_request, + build_maintenance_configurations_create_or_update_request, + build_maintenance_configurations_delete_request, + build_maintenance_configurations_get_request, + build_maintenance_configurations_list_by_managed_cluster_request, + build_managed_cluster_snapshots_create_or_update_request, + build_managed_cluster_snapshots_delete_request, + build_managed_cluster_snapshots_get_request, + build_managed_cluster_snapshots_list_by_resource_group_request, + build_managed_cluster_snapshots_list_request, + build_managed_cluster_snapshots_update_tags_request, + build_managed_clusters_abort_latest_operation_request, + build_managed_clusters_create_or_update_request, + build_managed_clusters_delete_request, + build_managed_clusters_get_access_profile_request, + build_managed_clusters_get_command_result_request, + build_managed_clusters_get_guardrails_versions_request, + build_managed_clusters_get_mesh_revision_profile_request, + build_managed_clusters_get_mesh_upgrade_profile_request, + build_managed_clusters_get_request, + build_managed_clusters_get_safeguards_versions_request, + build_managed_clusters_get_upgrade_profile_request, + build_managed_clusters_list_by_resource_group_request, + build_managed_clusters_list_cluster_admin_credentials_request, + build_managed_clusters_list_cluster_monitoring_user_credentials_request, + build_managed_clusters_list_cluster_user_credentials_request, + build_managed_clusters_list_guardrails_versions_request, + build_managed_clusters_list_kubernetes_versions_request, + build_managed_clusters_list_mesh_revision_profiles_request, + build_managed_clusters_list_mesh_upgrade_profiles_request, + build_managed_clusters_list_outbound_network_dependencies_endpoints_request, + build_managed_clusters_list_request, + build_managed_clusters_list_safeguards_versions_request, + build_managed_clusters_rebalance_load_balancers_request, + build_managed_clusters_reset_aad_profile_request, + build_managed_clusters_reset_service_principal_profile_request, + build_managed_clusters_rotate_cluster_certificates_request, + build_managed_clusters_rotate_service_account_signing_keys_request, + build_managed_clusters_run_command_request, + build_managed_clusters_start_request, + build_managed_clusters_stop_request, + build_managed_clusters_update_tags_request, + build_managed_namespaces_create_or_update_request, + build_managed_namespaces_delete_request, + build_managed_namespaces_get_request, + build_managed_namespaces_list_by_managed_cluster_request, + build_managed_namespaces_list_credential_request, + build_managed_namespaces_update_request, + build_mesh_memberships_create_or_update_request, + build_mesh_memberships_delete_request, + build_mesh_memberships_get_request, + build_mesh_memberships_list_by_managed_cluster_request, + build_operation_status_result_get_by_agent_pool_request, + build_operation_status_result_get_request, + build_operation_status_result_list_request, + build_operations_list_request, + build_private_endpoint_connections_delete_request, + build_private_endpoint_connections_get_request, + build_private_endpoint_connections_list_request, + build_private_endpoint_connections_update_request, + build_private_link_resources_list_request, + build_resolve_private_link_service_id_post_request, + build_snapshots_create_or_update_request, + build_snapshots_delete_request, + build_snapshots_get_request, + build_snapshots_list_by_resource_group_request, + build_snapshots_list_request, + build_snapshots_update_tags_request, + build_trusted_access_role_bindings_create_or_update_request, + build_trusted_access_role_bindings_delete_request, + build_trusted_access_role_bindings_get_request, + build_trusted_access_role_bindings_list_request, + build_trusted_access_roles_list_request, +) from .._configuration import ContainerServiceClientConfiguration +JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] List = list -class Operations: +class AgentPoolsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`operations` attribute. + :attr:`agent_pools` attribute. """ - models = _models - def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") @@ -54,22 +163,554 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.OperationValue"]: - """Gets a list of operations. + @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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: AgentPool. The AgentPool is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.AgentPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) - Gets a list of operations. + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - :return: An iterator like instance of either OperationValue or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.OperationValue] + cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) + + _request = build_agent_pools_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AgentPool, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: Union[_models.AgentPool, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_pools_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, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: _models.AgentPool, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """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.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 etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AgentPool. The AgentPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.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: JSON, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AgentPool. The AgentPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param parameters: The agent pool to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AgentPool. The AgentPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.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, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.AgentPool]: + """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 one of the following types: + AgentPool, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.AgentPool or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns AgentPool. The AgentPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + parameters=parameters, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AgentPool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_agent_pools_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, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """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 + :keyword 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. + :paramtype ignore_pod_disruption_budget: bool + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncItemPaged["_models.AgentPool"]: + """Gets a list of agent pools in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of AgentPool + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.AgentPool] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.AgentPool]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -82,12 +723,20 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.OperationValue"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_agent_pools_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -102,16 +751,12516 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AgentPool], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _abort_latest_operation_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_agent_pools_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Aborts last operation running on agent pool. + + Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + completes before cancellation can take place, a 409 error code is returned. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._abort_latest_operation_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "agent_pool_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def _complete_upgrade_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_agent_pools_complete_upgrade_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "agent_pool_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def begin_complete_upgrade( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Completes the upgrade of an agent pool. + + Completes the upgrade operation for the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._complete_upgrade_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _delete_machines_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(machines, (IOBase, bytes)): + _content = machines + else: + _content = json.dumps(machines, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_pools_delete_machines_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: _models.AgentPoolDeleteMachinesParameter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: ~azure.mgmt.containerservice.models.AgentPoolDeleteMachinesParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes specific machines in an agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Is one of the following + types: AgentPoolDeleteMachinesParameter, JSON, IO[bytes] Required. + :type machines: ~azure.mgmt.containerservice.models.AgentPoolDeleteMachinesParameter or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_machines_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machines=machines, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _upgrade_node_image_version_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_agent_pools_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_upgrade_node_image_version( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[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 + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get_available_agent_pool_versions( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.AgentPoolAvailableVersions: + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: AgentPoolAvailableVersions. The AgentPoolAvailableVersions is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.AgentPoolAvailableVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) + + _request = build_agent_pools_get_available_agent_pool_versions_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AgentPoolAvailableVersions, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # 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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: AgentPoolUpgradeProfile. The AgentPoolUpgradeProfile is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.AgentPoolUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_agent_pools_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AgentPoolUpgradeProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +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.aio.ContainerServiceClient`'s + :attr:`managed_clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: + """Gets a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: ManagedCluster. The ManagedCluster is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedCluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedCluster, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedCluster, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """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.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 etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ManagedCluster. The ManagedCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ManagedCluster. The ManagedCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The managed cluster to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ManagedCluster. The ManagedCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.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, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """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 one of the following types: + ManagedCluster, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedCluster or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ManagedCluster. The ManagedCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """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.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 etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ManagedCluster. The ManagedCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ManagedCluster. The ManagedCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ManagedCluster. The ManagedCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.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, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedCluster]: + """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 one of + the following types: TagsObject, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.TagsObject or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns ManagedCluster. The ManagedCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + params_added_on={"2025-10-02-preview": ["ignore_pod_disruption_budget"]}, + api_versions_list=["2025-10-01", "2025-10-02-preview"], + ) + async def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + params_added_on={"2025-10-02-preview": ["ignore_pod_disruption_budget"]}, + api_versions_list=["2025-10-01", "2025-10-02-preview"], + ) + async def begin_delete( + self, + resource_group_name: str, + resource_name: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """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 + :keyword 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. + :paramtype ignore_pod_disruption_budget: bool + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedCluster"]: + """Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ManagedCluster + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedCluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedCluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.ManagedCluster"]: + """Gets a list of managed clusters in the specified subscription. + + :return: An iterator like instance of ManagedCluster + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedCluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedCluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_access_profile( + self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any + ) -> _models.ManagedClusterAccessProfile: + """Gets an access profile of a managed cluster. + + **WARNING**: This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param role_name: The name of the role for managed cluster accessProfile resource. Required. + :type role_name: str + :return: ManagedClusterAccessProfile. The ManagedClusterAccessProfile is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterAccessProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedClusterAccessProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_admin_credentials( + self, resource_group_name: str, resource_name: str, *, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the admin credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. The name 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :paramtype server_fqdn: str + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any + ) -> _models.CredentialResults: + """Lists the user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. The name 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :paramtype server_fqdn: str + :keyword 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. + :paramtype format: str or ~azure.mgmt.containerservice.models.Format + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_cluster_monitoring_user_credentials( + self, resource_group_name: str, resource_name: str, *, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the cluster monitoring user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. The name 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :paramtype server_fqdn: str + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _reset_service_principal_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_reset_service_principal_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # 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.models.ManagedClusterServicePrincipalProfile + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :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: JSON, + *, + 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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The service principal profile to set on the managed cluster. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :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, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The service principal profile to set on the managed cluster. Is one of the + following types: ManagedClusterServicePrincipalProfile, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterServicePrincipalProfile or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _reset_aad_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_reset_aad_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterAADProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**: This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :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: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**: This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**: This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :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, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**: This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. Is one of the following + types: ManagedClusterAADProfile, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _rotate_cluster_certificates_initial( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_rotate_cluster_certificates_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_rotate_cluster_certificates( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._rotate_cluster_certificates_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _abort_latest_operation_initial( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_abort_latest_operation_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Aborts last operation running on managed cluster. + + Aborts the currently running operation on the managed cluster. The Managed Cluster will be + moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If + the operation completes before cancellation can take place, a 409 error code is returned. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._abort_latest_operation_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _rotate_service_account_signing_keys_initial( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_rotate_service_account_signing_keys_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rotates the service account signing keys of a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._rotate_service_account_signing_keys_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _stop_initial(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_stop_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._stop_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _start_initial(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_start_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._start_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(request_payload, (IOBase, bytes)): + _content = request_payload + else: + _content = json.dumps(request_payload, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_run_command_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: _models.RunCommandRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param request_payload: The run command request. Required. + :type request_payload: ~azure.mgmt.containerservice.models.RunCommandRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RunCommandResult. The RunCommandResult is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: JSON, + *, + 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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RunCommandResult. The RunCommandResult is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param request_payload: The run command request. Required. + :type request_payload: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RunCommandResult. The RunCommandResult is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.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, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param request_payload: The run command request. Is one of the following types: + RunCommandRequest, JSON, IO[bytes] Required. + :type request_payload: ~azure.mgmt.containerservice.models.RunCommandRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns RunCommandResult. The RunCommandResult is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RunCommandResult] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.RunCommandResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RunCommandResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RunCommandResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get_command_result( + self, resource_group_name: str, resource_name: str, command_id: str, **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + """Gets the results of a command which has been run on the Managed Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param command_id: Id of the command. Required. + :type command_id: str + :return: RunCommandResult or None. The RunCommandResult is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.RunCommandResult or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RunCommandResult, response.json()) + + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.OutboundEnvironmentEndpoint"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of OutboundEnvironmentEndpoint + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.OutboundEnvironmentEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OutboundEnvironmentEndpoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_outbound_network_dependencies_endpoints_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OutboundEnvironmentEndpoint], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "content_type", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def _rebalance_load_balancers_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_rebalance_load_balancers_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.RebalanceLoadBalancersRequestBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rebalance nodes across specific load balancers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Required. + :type parameters: ~azure.mgmt.containerservice.models.RebalanceLoadBalancersRequestBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rebalance nodes across specific load balancers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rebalance nodes across specific load balancers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "content_type", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Rebalance nodes across specific load balancers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Is one of the following types: RebalanceLoadBalancersRequestBody, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.RebalanceLoadBalancersRequestBody or JSON + or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._rebalance_load_balancers_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get_upgrade_profile( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.ManagedClusterUpgradeProfile: + """Gets the upgrade profile of a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: ManagedClusterUpgradeProfile. The ManagedClusterUpgradeProfile is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedClusterUpgradeProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def get_guardrails_versions( + self, location: str, version: str, **kwargs: Any + ) -> _models.GuardrailsAvailableVersion: + """Gets supported Guardrails version in the specified subscription and location. + + Contains Guardrails version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: GuardrailsAvailableVersion. The GuardrailsAvailableVersion is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.GuardrailsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_guardrails_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GuardrailsAvailableVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_guardrails_versions( + self, location: str, **kwargs: Any + ) -> AsyncItemPaged["_models.GuardrailsAvailableVersion"]: + """Gets a list of supported Guardrails versions in the specified subscription and location. + + Contains list of Guardrails version along with its support info and whether it is a default + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of GuardrailsAvailableVersion + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.GuardrailsAvailableVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.GuardrailsAvailableVersion]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_guardrails_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.GuardrailsAvailableVersion], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_safeguards_versions( + self, location: str, version: str, **kwargs: Any + ) -> _models.SafeguardsAvailableVersion: + """Gets supported Safeguards version in the specified subscription and location. + + Contains Safeguards version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: SafeguardsAvailableVersion. The SafeguardsAvailableVersion is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.SafeguardsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_safeguards_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SafeguardsAvailableVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_safeguards_versions( + self, location: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SafeguardsAvailableVersion"]: + """Gets a list of supported Safeguards versions in the specified subscription and location. + + Contains list of Safeguards version along with its support info and whether it is a default + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of SafeguardsAvailableVersion + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.SafeguardsAvailableVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SafeguardsAvailableVersion]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_safeguards_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SafeguardsAvailableVersion], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _models.MeshRevisionProfile: + """Gets a mesh revision profile for a specified mesh in the specified location. + + Contains extra metadata on the revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :type location: str + :param mode: The mode of the mesh. Required. + :type mode: str + :return: MeshRevisionProfile. The MeshRevisionProfile is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MeshRevisionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_mesh_revision_profile_request( + location=location, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MeshRevisionProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_mesh_revision_profiles( + self, location: str, **kwargs: Any + ) -> AsyncItemPaged["_models.MeshRevisionProfile"]: + """Lists mesh revision profiles for all meshes in the specified location. + + Contains extra metadata on each revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of MeshRevisionProfile + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.MeshRevisionProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MeshRevisionProfile]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_mesh_revision_profiles_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MeshRevisionProfile], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_mesh_upgrade_profile( + self, resource_group_name: str, resource_name: str, mode: str, **kwargs: Any + ) -> _models.MeshUpgradeProfile: + """Gets available upgrades for a service mesh in a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param mode: The mode of the mesh. Required. + :type mode: str + :return: MeshUpgradeProfile. The MeshUpgradeProfile is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MeshUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_mesh_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MeshUpgradeProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_mesh_upgrade_profiles( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.MeshUpgradeProfile"]: + """Lists available upgrades for all service meshes in a specific cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of MeshUpgradeProfile + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.MeshUpgradeProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MeshUpgradeProfile]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_mesh_upgrade_profiles_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MeshUpgradeProfile], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.KubernetesVersionListResult: + """Gets a list of supported Kubernetes versions in the specified subscription. + + Contains extra metadata on the version, including supported patch versions, capabilities, + available upgrades, and details on preview status of the version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: KubernetesVersionListResult. The KubernetesVersionListResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.KubernetesVersionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) + + _request = build_managed_clusters_list_kubernetes_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.KubernetesVersionListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class MaintenanceConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`maintenance_configurations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @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. + + :param resource_group_name: The name of the resource group. The name is 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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) + + _request = build_maintenance_configurations_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MaintenanceConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: _models.MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is 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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :param parameters: The maintenance configuration to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.MaintenanceConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.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: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :param parameters: The maintenance configuration to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is 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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :param parameters: The maintenance configuration to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.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, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :param parameters: The maintenance configuration to create or update. Is one of the following + types: MaintenanceConfiguration, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.MaintenanceConfiguration or JSON or + IO[bytes] + :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_maintenance_configurations_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MaintenanceConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any) -> None: + """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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_maintenance_configurations_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.MaintenanceConfiguration"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of MaintenanceConfiguration + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.MaintenanceConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MaintenanceConfiguration]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_maintenance_configurations_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MaintenanceConfiguration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedNamespacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`managed_namespaces` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any + ) -> _models.ManagedNamespace: + """Gets the specified namespace of a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :return: ManagedNamespace. The ManagedNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) + + _request = build_managed_namespaces_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedNamespace, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: Union[_models.ManagedNamespace, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_namespaces_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: _models.ManagedNamespace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedNamespace]: + """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can + configure aspects like resource quotas, network ingress/egress policies, and more. See + aka.ms/aks/managed-namespaces for more details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: The namespace to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedNamespace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedNamespace. The ManagedNamespace is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedNamespace]: + """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can + configure aspects like resource quotas, network ingress/egress policies, and more. See + aka.ms/aks/managed-namespaces for more details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: The namespace to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedNamespace. The ManagedNamespace is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedNamespace]: + """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can + configure aspects like resource quotas, network ingress/egress policies, and more. See + aka.ms/aks/managed-namespaces for more details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: The namespace to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedNamespace. The ManagedNamespace is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: Union[_models.ManagedNamespace, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedNamespace]: + """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can + configure aspects like resource quotas, network ingress/egress policies, and more. See + aka.ms/aks/managed-namespaces for more details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: The namespace to create or update. Is one of the following types: + ManagedNamespace, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedNamespace or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedNamespace. The ManagedNamespace is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedNamespace, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedNamespace].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedNamespace]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedNamespace: + """Updates tags on a managed namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Required. + :type parameters: ~azure.mgmt.containerservice.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedNamespace. The ManagedNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedNamespace: + """Updates tags on a managed namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedNamespace. The ManagedNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedNamespace: + """Updates tags on a managed namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedNamespace. The ManagedNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: Union[_models.TagsObject, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedNamespace: + """Updates tags on a managed namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Is one of the following types: TagsObject, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.TagsObject or JSON or IO[bytes] + :return: ManagedNamespace. The ManagedNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_namespaces_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedNamespace, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_namespaces_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedNamespace"]: + """Gets a list of managed namespaces in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of ManagedNamespace + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.ManagedNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedNamespace]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_namespaces_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedNamespace], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def list_credential( + self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the credentials of a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_managed_namespaces_list_credential_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class MachinesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`machines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, machine_name: str, **kwargs: Any + ) -> _models.Machine: + """Get a specific machine in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machine_name: Host name of the machine. Required. + :type machine_name: str + :return: Machine. The Machine is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Machine + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Machine] = kwargs.pop("cls", None) + + _request = build_machines_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Machine, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "agent_pool_name", + "machine_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + parameters: Union[_models.Machine, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_machines_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + parameters: _models.Machine, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.Machine]: + """Creates or updates a machine in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machine_name: Host name of the machine. Required. + :type machine_name: str + :param parameters: The machine to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.Machine + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Machine. The Machine is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.Machine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.Machine]: + """Creates or updates a machine in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machine_name: Host name of the machine. Required. + :type machine_name: str + :param parameters: The machine to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Machine. The Machine is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.Machine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.Machine]: + """Creates or updates a machine in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machine_name: Host name of the machine. Required. + :type machine_name: str + :param parameters: The machine to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Machine. The Machine is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.Machine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "agent_pool_name", + "machine_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + parameters: Union[_models.Machine, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.Machine]: + """Creates or updates a machine in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machine_name: Host name of the machine. Required. + :type machine_name: str + :param parameters: The machine to create or update. Is one of the following types: Machine, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.Machine or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of AsyncLROPoller that returns Machine. The Machine is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.Machine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Machine] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + parameters=parameters, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Machine, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Machine].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Machine]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Machine"]: + """Gets a list of machines in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: An iterator like instance of Machine + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.Machine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Machine]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_machines_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Machine], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PrivateEndpointConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + `https://docs.microsoft.com/azure/aks/private-clusters + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is 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.models.PrivateEndpointConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.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: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: The updated private endpoint connection. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.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, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """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 one of the following types: + PrivateEndpointConnection, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.PrivateEndpointConnection or JSON or + IO[bytes] + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_private_endpoint_connections_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnectionListResult: + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + `https://docs.microsoft.com/azure/aks/private-clusters + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: PrivateEndpointConnectionListResult. The PrivateEndpointConnectionListResult is + compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnectionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnectionListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class SnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`snapshots` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.Snapshot: + """Gets a snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + _request = build_snapshots_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Snapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.Snapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. The name is 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.models.Snapshot + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The snapshot to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.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, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.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 one of the following types: Snapshot, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.Snapshot or JSON or IO[bytes] + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_snapshots_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Snapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + :param resource_group_name: The name of the resource group. The name is 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.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: Parameters supplied to the Update snapshot Tags operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.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, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.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 one of the + following types: TagsObject, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.TagsObject or JSON or IO[bytes] + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_snapshots_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Snapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> None: + """Deletes a snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_snapshots_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Snapshot"]: + """Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Snapshot + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Snapshot]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_snapshots_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Snapshot], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Snapshot"]: + """Gets a list of snapshots in the specified subscription. + + :return: An iterator like instance of Snapshot + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Snapshot]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_snapshots_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Snapshot], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedClusterSnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`managed_cluster_snapshots` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedClusterSnapshot: + """Gets a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + _request = build_managed_cluster_snapshots_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedClusterSnapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterSnapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is 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.models.ManagedClusterSnapshot + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The managed cluster snapshot to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterSnapshot, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """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 one of the following + types: ManagedClusterSnapshot, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot or JSON or + IO[bytes] + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_cluster_snapshots_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedClusterSnapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is 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.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """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 one of the following types: TagsObject, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.TagsObject or JSON or IO[bytes] + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_cluster_snapshots_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedClusterSnapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name"] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> None: + """Deletes a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_cluster_snapshots_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={"2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + api_versions_list=["2025-10-02-preview"], + ) + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedClusterSnapshot"]: + """Lists managed cluster snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ManagedClusterSnapshot + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.ManagedClusterSnapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedClusterSnapshot]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_cluster_snapshots_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedClusterSnapshot], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={"2025-10-02-preview": ["api_version", "subscription_id", "accept"]}, + api_versions_list=["2025-10-02-preview"], + ) + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.ManagedClusterSnapshot"]: + """Gets a list of managed cluster snapshots in the specified subscription. + + :return: An iterator like instance of ManagedClusterSnapshot + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.ManagedClusterSnapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedClusterSnapshot]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_cluster_snapshots_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedClusterSnapshot], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class TrustedAccessRoleBindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`trusted_access_role_bindings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :return: TrustedAccessRoleBinding. The TrustedAccessRoleBinding is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + _request = build_trusted_access_role_bindings_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TrustedAccessRoleBinding, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(trusted_access_role_binding, (IOBase, bytes)): + _content = trusted_access_role_binding + else: + _content = json.dumps(trusted_access_role_binding, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_trusted_access_role_bindings_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: _models.TrustedAccessRoleBinding, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + :param resource_group_name: The name of the resource group. The name is 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.models.TrustedAccessRoleBinding + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TrustedAccessRoleBinding. The + TrustedAccessRoleBinding is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TrustedAccessRoleBinding. The + TrustedAccessRoleBinding is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :param trusted_access_role_binding: A trusted access role binding. Required. + :type trusted_access_role_binding: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns TrustedAccessRoleBinding. The + TrustedAccessRoleBinding is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: + """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 one of the following + types: TrustedAccessRoleBinding, JSON, IO[bytes] Required. + :type trusted_access_role_binding: ~azure.mgmt.containerservice.models.TrustedAccessRoleBinding + or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns TrustedAccessRoleBinding. The + TrustedAccessRoleBinding is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + trusted_access_role_binding=trusted_access_role_binding, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TrustedAccessRoleBinding, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.TrustedAccessRoleBinding].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.TrustedAccessRoleBinding]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_trusted_access_role_bindings_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a trusted access role binding. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.TrustedAccessRoleBinding"]: + """List trusted access role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of TrustedAccessRoleBinding + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TrustedAccessRoleBinding]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_trusted_access_role_bindings_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TrustedAccessRoleBinding], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LoadBalancersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`load_balancers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "load_balancer_name", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def get( + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> _models.LoadBalancer: + """Gets the specified load balancer. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: LoadBalancer. The LoadBalancer is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _request = build_load_balancers_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LoadBalancer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + parameters: _models.LoadBalancer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: The load balancer to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.LoadBalancer + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: LoadBalancer. The LoadBalancer is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: The load balancer to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: LoadBalancer. The LoadBalancer is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: The load balancer to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: LoadBalancer. The LoadBalancer is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "load_balancer_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + parameters: Union[_models.LoadBalancer, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: The load balancer to create or update. Is one of the following types: + LoadBalancer, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.LoadBalancer or JSON or IO[bytes] + :return: LoadBalancer. The LoadBalancer is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_load_balancers_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LoadBalancer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "load_balancer_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_load_balancers_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "load_balancer_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def begin_delete( + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a load balancer in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.LoadBalancer"]: + """Gets a list of load balancers in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of LoadBalancer + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LoadBalancer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancers_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LoadBalancer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class IdentityBindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`identity_bindings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "identity_binding_name", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def get( + self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any + ) -> _models.IdentityBinding: + """Gets the specified Identity 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :return: IdentityBinding. The IdentityBinding is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.IdentityBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IdentityBinding] = kwargs.pop("cls", None) + + _request = build_identity_bindings_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + identity_binding_name=identity_binding_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IdentityBinding, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "identity_binding_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + identity_binding_name: str, + parameters: Union[_models.IdentityBinding, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_identity_bindings_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + identity_binding_name=identity_binding_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + identity_binding_name: str, + parameters: _models.IdentityBinding, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IdentityBinding]: + """Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :param parameters: The identity binding to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.IdentityBinding + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns IdentityBinding. The IdentityBinding is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.IdentityBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + identity_binding_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IdentityBinding]: + """Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :param parameters: The identity binding to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns IdentityBinding. The IdentityBinding is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.IdentityBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + identity_binding_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.IdentityBinding]: + """Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :param parameters: The identity binding to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns IdentityBinding. The IdentityBinding is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.IdentityBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "identity_binding_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + identity_binding_name: str, + parameters: Union[_models.IdentityBinding, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.IdentityBinding]: + """Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :param parameters: The identity binding to create or update. Is one of the following types: + IdentityBinding, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.IdentityBinding or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns IdentityBinding. The IdentityBinding is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.IdentityBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IdentityBinding] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + identity_binding_name=identity_binding_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IdentityBinding, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.IdentityBinding].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.IdentityBinding]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "identity_binding_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_identity_bindings_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + identity_binding_name=identity_binding_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "identity_binding_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def begin_delete( + self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an identity binding 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + identity_binding_name=identity_binding_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.IdentityBinding"]: + """Gets a list of identity bindings in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of IdentityBinding + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.IdentityBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IdentityBinding]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_identity_bindings_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IdentityBinding], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JWTAuthenticatorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`jwt_authenticators` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "jwt_authenticator_name", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def get( + self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any + ) -> _models.JWTAuthenticator: + """Gets the specified JWT authenticator 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 jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :return: JWTAuthenticator. The JWTAuthenticator is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.JWTAuthenticator + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JWTAuthenticator] = kwargs.pop("cls", None) + + _request = build_jwt_authenticators_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + jwt_authenticator_name=jwt_authenticator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JWTAuthenticator, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "jwt_authenticator_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + jwt_authenticator_name: str, + parameters: Union[_models.JWTAuthenticator, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jwt_authenticators_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + jwt_authenticator_name=jwt_authenticator_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + jwt_authenticator_name: str, + parameters: _models.JWTAuthenticator, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JWTAuthenticator]: + """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to + apply the settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :param parameters: The JWT authenticator to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.JWTAuthenticator + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns JWTAuthenticator. The JWTAuthenticator is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + jwt_authenticator_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JWTAuthenticator]: + """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to + apply the settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :param parameters: The JWT authenticator to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns JWTAuthenticator. The JWTAuthenticator is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + jwt_authenticator_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JWTAuthenticator]: + """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to + apply the settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :param parameters: The JWT authenticator to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns JWTAuthenticator. The JWTAuthenticator is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "jwt_authenticator_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + jwt_authenticator_name: str, + parameters: Union[_models.JWTAuthenticator, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.JWTAuthenticator]: + """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to + apply the settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :param parameters: The JWT authenticator to create or update. Is one of the following types: + JWTAuthenticator, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.JWTAuthenticator or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns JWTAuthenticator. The JWTAuthenticator is + compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JWTAuthenticator] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + jwt_authenticator_name=jwt_authenticator_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JWTAuthenticator, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JWTAuthenticator].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JWTAuthenticator]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "jwt_authenticator_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_jwt_authenticators_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + jwt_authenticator_name=jwt_authenticator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "jwt_authenticator_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def begin_delete( + self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a JWT authenticator and updates the managed cluster to apply the settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + jwt_authenticator_name=jwt_authenticator_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.JWTAuthenticator"]: + """Gets a list of JWT authenticators in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of JWTAuthenticator + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.JWTAuthenticator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JWTAuthenticator]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_jwt_authenticators_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JWTAuthenticator], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class MeshMembershipsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`mesh_memberships` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "mesh_membership_name", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def get( + self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any + ) -> _models.MeshMembership: + """Gets the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :return: MeshMembership. The MeshMembership is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MeshMembership + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MeshMembership] = kwargs.pop("cls", None) + + _request = build_mesh_memberships_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mesh_membership_name=mesh_membership_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MeshMembership, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "mesh_membership_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + mesh_membership_name: str, + parameters: Union[_models.MeshMembership, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_mesh_memberships_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mesh_membership_name=mesh_membership_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + mesh_membership_name: str, + parameters: _models.MeshMembership, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MeshMembership]: + """Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :param parameters: The mesh membership to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.MeshMembership + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MeshMembership. The MeshMembership is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.MeshMembership] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + mesh_membership_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MeshMembership]: + """Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :param parameters: The mesh membership to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MeshMembership. The MeshMembership is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.MeshMembership] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + mesh_membership_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.MeshMembership]: + """Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :param parameters: The mesh membership to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns MeshMembership. The MeshMembership is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.MeshMembership] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "mesh_membership_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + mesh_membership_name: str, + parameters: Union[_models.MeshMembership, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.MeshMembership]: + """Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :param parameters: The mesh membership to create or update. Is one of the following types: + MeshMembership, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.MeshMembership or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns MeshMembership. The MeshMembership is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.MeshMembership] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MeshMembership] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + mesh_membership_name=mesh_membership_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MeshMembership, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.MeshMembership].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.MeshMembership]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "mesh_membership_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def _delete_initial( + self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_mesh_memberships_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mesh_membership_name=mesh_membership_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "mesh_membership_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def begin_delete( + self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + mesh_membership_name=mesh_membership_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.MeshMembership"]: + """Lists mesh memberships in a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of MeshMembership + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.MeshMembership] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MeshMembership]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_mesh_memberships_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MeshMembership], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.OperationValue"]: + """Gets a list of operations. + + :return: An iterator like instance of OperationValue + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.OperationValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OperationValue]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OperationValue], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class OperationStatusResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`operation_status_result` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "agent_pool_name", + "operation_id", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def get_by_agent_pool( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param operation_id: The ID of an ongoing async operation. Required. + :type operation_id: str + :return: OperationStatusResult. The OperationStatusResult is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_operation_status_result_get_by_agent_pool_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.OperationStatusResult"]: + """Gets a list of operations in the specified managedCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of OperationStatusResult + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operation_status_result_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OperationStatusResult], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "operation_id", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + async def get( + self, resource_group_name: str, resource_name: str, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param operation_id: The ID of an ongoing async operation. Required. + :type operation_id: str + :return: OperationStatusResult. The OperationStatusResult is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_operation_status_result_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PrivateLinkResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`private_link_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.PrivateLinkResourcesListResult: + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + `https://docs.microsoft.com/azure/aks/private-clusters + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: PrivateLinkResourcesListResult. The PrivateLinkResourcesListResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResourcesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) + + _request = build_private_link_resources_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateLinkResourcesListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ResolvePrivateLinkServiceIdOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`resolve_private_link_service_id` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @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. + + :param resource_group_name: The name of the resource group. The name is 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.models.PrivateLinkResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def post( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: Parameters required in order to resolve a private link service ID. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.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, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkResource: + """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 one of + the following types: PrivateLinkResource, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.PrivateLinkResource or JSON or IO[bytes] + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_resolve_private_link_service_id_post_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateLinkResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class TrustedAccessRolesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`trusted_access_roles` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.TrustedAccessRole"]: + """List supported trusted access roles. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of TrustedAccessRole + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.TrustedAccessRole] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TrustedAccessRole]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_trusted_access_roles_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TrustedAccessRole], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ContainerServiceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s + :attr:`container_service` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_node_image_versions(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.NodeImageVersion"]: + """Gets a list of supported NodeImage versions in the specified subscription. + + Only returns the latest version of each node image. For example there may be an + AKSUbuntu-1804gen2containerd-2024.01.26, but only AKSUbuntu-1804gen2containerd-2024.02.02 is + visible in this list. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of NodeImageVersion + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.NodeImageVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NodeImageVersion]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_container_service_list_node_image_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NodeImageVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -124,9 +13273,9 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( + error = _failsafe_deserialize( _models.ErrorResponse, - pipeline_response, + response, ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_patch.py @@ -7,9 +7,9 @@ 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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index 832f404c47eb..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,459 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._private_endpoint_connections_operations import ( - build_delete_request, - build_get_request, - build_list_request, - build_update_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class PrivateEndpointConnectionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnectionListResult: - """Gets a list of private endpoint connections in the specified managed cluster. - - To learn more about private clusters, see: - https://docs.microsoft.com/azure/aks/private-clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: PrivateEndpointConnectionListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnectionListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Gets the specified private endpoint connection. - - To learn more about private clusters, see: - https://docs.microsoft.com/azure/aks/private-clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - parameters: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Updates a private endpoint connection. - - Updates a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param parameters: The updated private endpoint connection. Required. - :type parameters: ~azure.mgmt.containerservice.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Updates a private endpoint connection. - - Updates a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param parameters: The updated private endpoint connection. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Updates a private endpoint connection. - - Updates a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param parameters: The updated private endpoint connection. Is either a - PrivateEndpointConnection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.PrivateEndpointConnection or IO[bytes] - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "PrivateEndpointConnection") - - _request = build_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a private endpoint connection. - - Deletes a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 75359f8ffedb..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._private_link_resources_operations import build_list_request -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class PrivateLinkResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`private_link_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> _models.PrivateLinkResourcesListResult: - """Gets a list of private link resources in the specified managed cluster. - - To learn more about private clusters, see: - https://docs.microsoft.com/azure/aks/private-clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: PrivateLinkResourcesListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResourcesListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_resolve_private_link_service_id_operations.py deleted file mode 100644 index e173bbbc3ef4..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_resolve_private_link_service_id_operations.py +++ /dev/null @@ -1,194 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._resolve_private_link_service_id_operations import build_post_request -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ResolvePrivateLinkServiceIdOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`resolve_private_link_service_id` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @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.models.PrivateLinkResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def post( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateLinkResource: - """Gets the private link service ID for the specified managed cluster. - - Gets the private link service ID for the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters required in order to resolve a private link service ID. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def post( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.PrivateLinkResource, IO[bytes]], - **kwargs: Any - ) -> _models.PrivateLinkResource: - """Gets the private link service ID for the specified managed cluster. - - Gets the private link service ID for the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters required in order to resolve a private link service ID. Is either - a PrivateLinkResource type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.PrivateLinkResource or IO[bytes] - :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "PrivateLinkResource") - - _request = build_post_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateLinkResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_snapshots_operations.py deleted file mode 100644 index a09e86da1a95..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_snapshots_operations.py +++ /dev/null @@ -1,626 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._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, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SnapshotsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`snapshots` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Snapshot"]: - """Gets a list of snapshots in the specified subscription. - - Gets a list of snapshots in the specified subscription. - - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Snapshot"]: - """Lists snapshots in the specified subscription and resource group. - - Lists snapshots in the specified subscription and resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.Snapshot: - """Gets a snapshot. - - Gets a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Snapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Snapshot: - """Creates or updates a snapshot. - - Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The snapshot to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.Snapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Snapshot: - """Creates or updates a snapshot. - - Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The snapshot to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.Snapshot, IO[bytes]], - **kwargs: Any - ) -> _models.Snapshot: - """Creates or updates a snapshot. - - Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.containerservice.models.Snapshot or IO[bytes] - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Snapshot") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Snapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.TagsObject, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Snapshot: - """Updates tags on a snapshot. - - Updates tags on a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update snapshot Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Snapshot: - """Updates tags on a snapshot. - - Updates tags on a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update snapshot Tags operation. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO[bytes]], - **kwargs: Any - ) -> _models.Snapshot: - """Updates tags on a snapshot. - - Updates tags on a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update snapshot Tags operation. Is either a - TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject or IO[bytes] - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TagsObject") - - _request = build_update_tags_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Snapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> None: - """Deletes a snapshot. - - Deletes a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_trusted_access_role_bindings_operations.py deleted file mode 100644 index 07c07d19d191..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_trusted_access_role_bindings_operations.py +++ /dev/null @@ -1,560 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._trusted_access_role_bindings_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_request, -) -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class TrustedAccessRoleBindingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`trusted_access_role_bindings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.TrustedAccessRoleBinding"]: - """List trusted access role bindings. - - List trusted access role bindings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either TrustedAccessRoleBinding or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("TrustedAccessRoleBindingListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any - ) -> _models.TrustedAccessRoleBinding: - """Get a trusted access role binding. - - Get a trusted access role binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param trusted_access_role_binding_name: The name of trusted access role binding. Required. - :type trusted_access_role_binding_name: str - :return: TrustedAccessRoleBinding or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.TrustedAccessRoleBinding - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - trusted_access_role_binding_name=trusted_access_role_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(trusted_access_role_binding, (IOBase, bytes)): - _content = trusted_access_role_binding - else: - _json = self._serialize.body(trusted_access_role_binding, "TrustedAccessRoleBinding") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - trusted_access_role_binding_name=trusted_access_role_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - trusted_access_role_binding: _models.TrustedAccessRoleBinding, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: - """Create or update a trusted access role binding. - - Create or update a trusted access role binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param trusted_access_role_binding_name: The name of trusted access role binding. Required. - :type trusted_access_role_binding_name: str - :param trusted_access_role_binding: A trusted access role binding. Required. - :type trusted_access_role_binding: ~azure.mgmt.containerservice.models.TrustedAccessRoleBinding - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either TrustedAccessRoleBinding or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - trusted_access_role_binding: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: - """Create or update a trusted access role binding. - - Create or update a trusted access role binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param trusted_access_role_binding_name: The name of trusted access role binding. Required. - :type trusted_access_role_binding_name: str - :param trusted_access_role_binding: A trusted access role binding. Required. - :type trusted_access_role_binding: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either TrustedAccessRoleBinding or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.TrustedAccessRoleBinding]: - """Create or update a trusted access role binding. - - Create or update a trusted access role binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param trusted_access_role_binding_name: The name of trusted access role binding. Required. - :type trusted_access_role_binding_name: str - :param trusted_access_role_binding: A trusted access role binding. Is either a - TrustedAccessRoleBinding type or a IO[bytes] type. Required. - :type trusted_access_role_binding: ~azure.mgmt.containerservice.models.TrustedAccessRoleBinding - or IO[bytes] - :return: An instance of AsyncLROPoller that returns either TrustedAccessRoleBinding or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - trusted_access_role_binding_name=trusted_access_role_binding_name, - trusted_access_role_binding=trusted_access_role_binding, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.TrustedAccessRoleBinding].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.TrustedAccessRoleBinding]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - trusted_access_role_binding_name=trusted_access_role_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a trusted access role binding. - - Delete a trusted access role binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param trusted_access_role_binding_name: The name of trusted access role binding. Required. - :type trusted_access_role_binding_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - trusted_access_role_binding_name=trusted_access_role_binding_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_trusted_access_roles_operations.py deleted file mode 100644 index cc473f5fdc09..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/aio/operations/_trusted_access_roles_operations.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._trusted_access_roles_operations import build_list_request -from .._configuration import ContainerServiceClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class TrustedAccessRolesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.aio.ContainerServiceClient`'s - :attr:`trusted_access_roles` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, location: str, **kwargs: Any) -> AsyncItemPaged["_models.TrustedAccessRole"]: - """List supported trusted access roles. - - List supported trusted access roles. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either TrustedAccessRole or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.containerservice.models.TrustedAccessRole] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("TrustedAccessRoleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/__init__.py index 30bba0c79440..7125a9ca263e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,8 +13,9 @@ from ._patch import * # pylint: disable=unused-wildcard-import -from ._models_py3 import ( # type: ignore +from ._models import ( # type: ignore AbsoluteMonthlySchedule, + AccessProfile, AdvancedNetworking, AdvancedNetworkingObservability, AdvancedNetworkingPerformance, @@ -23,22 +24,24 @@ AgentPool, AgentPoolArtifactStreamingProfile, AgentPoolAvailableVersions, + AgentPoolAvailableVersionsProperties, AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem, AgentPoolBlueGreenUpgradeSettings, AgentPoolDeleteMachinesParameter, AgentPoolGatewayProfile, - AgentPoolListResult, AgentPoolNetworkProfile, AgentPoolRecentlyUsedVersion, AgentPoolSecurityProfile, AgentPoolStatus, AgentPoolUpgradeProfile, + AgentPoolUpgradeProfileProperties, AgentPoolUpgradeProfilePropertiesUpgradesItem, AgentPoolUpgradeSettings, AgentPoolWindowsProfile, AutoScaleProfile, AzureKeyVaultKms, ClusterUpgradeSettings, + CommandResultProperties, CompatibleVersions, Component, ComponentsByRelease, @@ -62,11 +65,9 @@ ExtendedLocation, GPUProfile, GuardrailsAvailableVersion, - GuardrailsAvailableVersionsList, GuardrailsAvailableVersionsProperties, IPTag, IdentityBinding, - IdentityBindingListResult, IdentityBindingManagedIdentityProfile, IdentityBindingOidcIssuerProfile, IdentityBindingProperties, @@ -81,7 +82,6 @@ JWTAuthenticatorClaimMappings, JWTAuthenticatorExtraClaimMappingExpression, JWTAuthenticatorIssuer, - JWTAuthenticatorListResult, JWTAuthenticatorProperties, JWTAuthenticatorValidationRule, KubeletConfig, @@ -94,14 +94,13 @@ LabelSelectorRequirement, LinuxOSConfig, LoadBalancer, - LoadBalancerListResult, + LoadBalancerProperties, LocalDNSOverride, LocalDNSProfile, Machine, MachineHardwareProfile, MachineIpAddress, MachineKubernetesProfile, - MachineListResult, MachineNetworkProperties, MachineOSProfile, MachineOSProfileLinuxProfile, @@ -109,7 +108,7 @@ MachineSecurityProfile, MachineStatus, MaintenanceConfiguration, - MaintenanceConfigurationListResult, + MaintenanceConfigurationProperties, MaintenanceWindow, ManagedCluster, ManagedClusterAADProfile, @@ -140,7 +139,6 @@ ManagedClusterIngressProfileGatewayConfiguration, ManagedClusterIngressProfileNginx, ManagedClusterIngressProfileWebAppRouting, - ManagedClusterListResult, ManagedClusterLoadBalancerProfile, ManagedClusterLoadBalancerProfileManagedOutboundIPs, ManagedClusterLoadBalancerProfileOutboundIPPrefixes, @@ -159,6 +157,7 @@ ManagedClusterPodIdentityProvisioningInfo, ManagedClusterPoolUpgradeProfile, ManagedClusterPoolUpgradeProfileUpgradesItem, + ManagedClusterProperties, ManagedClusterPropertiesAutoScalerProfile, ManagedClusterPropertiesForSnapshot, ManagedClusterSKU, @@ -173,7 +172,7 @@ ManagedClusterSecurityProfileWorkloadIdentity, ManagedClusterServicePrincipalProfile, ManagedClusterSnapshot, - ManagedClusterSnapshotListResult, + ManagedClusterSnapshotProperties, ManagedClusterStaticEgressGatewayProfile, ManagedClusterStatus, ManagedClusterStorageProfile, @@ -182,41 +181,36 @@ ManagedClusterStorageProfileFileCSIDriver, ManagedClusterStorageProfileSnapshotController, ManagedClusterUpgradeProfile, + ManagedClusterUpgradeProfileProperties, ManagedClusterWindowsProfile, ManagedClusterWorkloadAutoScalerProfile, ManagedClusterWorkloadAutoScalerProfileKeda, ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler, ManagedNamespace, - ManagedNamespaceListResult, ManagedServiceIdentityUserAssignedIdentitiesValue, ManualScaleProfile, MeshMembership, MeshMembershipProperties, - MeshMembershipsListResult, MeshRevision, MeshRevisionProfile, - MeshRevisionProfileList, MeshRevisionProfileProperties, MeshUpgradeProfile, - MeshUpgradeProfileList, MeshUpgradeProfileProperties, NamespaceProperties, NetworkPolicies, NetworkProfileForSnapshot, NodeCustomizationProfile, NodeImageVersion, - NodeImageVersionsListResult, - OperationListResult, OperationStatusResult, - OperationStatusResultList, OperationValue, + OperationValueDisplay, OutboundEnvironmentEndpoint, - OutboundEnvironmentEndpointCollection, PortRange, PowerState, PrivateEndpoint, PrivateEndpointConnection, PrivateEndpointConnectionListResult, + PrivateEndpointConnectionProperties, PrivateLinkResource, PrivateLinkResourcesListResult, PrivateLinkServiceConnectionState, @@ -229,7 +223,6 @@ RunCommandRequest, RunCommandResult, SafeguardsAvailableVersion, - SafeguardsAvailableVersionsList, SafeguardsAvailableVersionsProperties, ScaleProfile, Schedule, @@ -238,8 +231,7 @@ SchedulerProfileSchedulerInstanceProfiles, ServiceMeshProfile, Snapshot, - SnapshotListResult, - SubResource, + SnapshotProperties, SysctlConfig, SystemData, TagsObject, @@ -248,8 +240,7 @@ TrackedResource, TrustedAccessRole, TrustedAccessRoleBinding, - TrustedAccessRoleBindingListResult, - TrustedAccessRoleListResult, + TrustedAccessRoleBindingProperties, TrustedAccessRoleRule, UpgradeOverrideSettings, UserAssignedIdentity, @@ -259,7 +250,7 @@ WindowsGmsaProfile, ) -from ._container_service_client_enums import ( # type: ignore +from ._enums import ( # type: ignore AccelerationMode, AddonAutoscaling, AdoptionPolicy, @@ -354,6 +345,7 @@ __all__ = [ "AbsoluteMonthlySchedule", + "AccessProfile", "AdvancedNetworking", "AdvancedNetworkingObservability", "AdvancedNetworkingPerformance", @@ -362,22 +354,24 @@ "AgentPool", "AgentPoolArtifactStreamingProfile", "AgentPoolAvailableVersions", + "AgentPoolAvailableVersionsProperties", "AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem", "AgentPoolBlueGreenUpgradeSettings", "AgentPoolDeleteMachinesParameter", "AgentPoolGatewayProfile", - "AgentPoolListResult", "AgentPoolNetworkProfile", "AgentPoolRecentlyUsedVersion", "AgentPoolSecurityProfile", "AgentPoolStatus", "AgentPoolUpgradeProfile", + "AgentPoolUpgradeProfileProperties", "AgentPoolUpgradeProfilePropertiesUpgradesItem", "AgentPoolUpgradeSettings", "AgentPoolWindowsProfile", "AutoScaleProfile", "AzureKeyVaultKms", "ClusterUpgradeSettings", + "CommandResultProperties", "CompatibleVersions", "Component", "ComponentsByRelease", @@ -401,11 +395,9 @@ "ExtendedLocation", "GPUProfile", "GuardrailsAvailableVersion", - "GuardrailsAvailableVersionsList", "GuardrailsAvailableVersionsProperties", "IPTag", "IdentityBinding", - "IdentityBindingListResult", "IdentityBindingManagedIdentityProfile", "IdentityBindingOidcIssuerProfile", "IdentityBindingProperties", @@ -420,7 +412,6 @@ "JWTAuthenticatorClaimMappings", "JWTAuthenticatorExtraClaimMappingExpression", "JWTAuthenticatorIssuer", - "JWTAuthenticatorListResult", "JWTAuthenticatorProperties", "JWTAuthenticatorValidationRule", "KubeletConfig", @@ -433,14 +424,13 @@ "LabelSelectorRequirement", "LinuxOSConfig", "LoadBalancer", - "LoadBalancerListResult", + "LoadBalancerProperties", "LocalDNSOverride", "LocalDNSProfile", "Machine", "MachineHardwareProfile", "MachineIpAddress", "MachineKubernetesProfile", - "MachineListResult", "MachineNetworkProperties", "MachineOSProfile", "MachineOSProfileLinuxProfile", @@ -448,7 +438,7 @@ "MachineSecurityProfile", "MachineStatus", "MaintenanceConfiguration", - "MaintenanceConfigurationListResult", + "MaintenanceConfigurationProperties", "MaintenanceWindow", "ManagedCluster", "ManagedClusterAADProfile", @@ -479,7 +469,6 @@ "ManagedClusterIngressProfileGatewayConfiguration", "ManagedClusterIngressProfileNginx", "ManagedClusterIngressProfileWebAppRouting", - "ManagedClusterListResult", "ManagedClusterLoadBalancerProfile", "ManagedClusterLoadBalancerProfileManagedOutboundIPs", "ManagedClusterLoadBalancerProfileOutboundIPPrefixes", @@ -498,6 +487,7 @@ "ManagedClusterPodIdentityProvisioningInfo", "ManagedClusterPoolUpgradeProfile", "ManagedClusterPoolUpgradeProfileUpgradesItem", + "ManagedClusterProperties", "ManagedClusterPropertiesAutoScalerProfile", "ManagedClusterPropertiesForSnapshot", "ManagedClusterSKU", @@ -512,7 +502,7 @@ "ManagedClusterSecurityProfileWorkloadIdentity", "ManagedClusterServicePrincipalProfile", "ManagedClusterSnapshot", - "ManagedClusterSnapshotListResult", + "ManagedClusterSnapshotProperties", "ManagedClusterStaticEgressGatewayProfile", "ManagedClusterStatus", "ManagedClusterStorageProfile", @@ -521,41 +511,36 @@ "ManagedClusterStorageProfileFileCSIDriver", "ManagedClusterStorageProfileSnapshotController", "ManagedClusterUpgradeProfile", + "ManagedClusterUpgradeProfileProperties", "ManagedClusterWindowsProfile", "ManagedClusterWorkloadAutoScalerProfile", "ManagedClusterWorkloadAutoScalerProfileKeda", "ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler", "ManagedNamespace", - "ManagedNamespaceListResult", "ManagedServiceIdentityUserAssignedIdentitiesValue", "ManualScaleProfile", "MeshMembership", "MeshMembershipProperties", - "MeshMembershipsListResult", "MeshRevision", "MeshRevisionProfile", - "MeshRevisionProfileList", "MeshRevisionProfileProperties", "MeshUpgradeProfile", - "MeshUpgradeProfileList", "MeshUpgradeProfileProperties", "NamespaceProperties", "NetworkPolicies", "NetworkProfileForSnapshot", "NodeCustomizationProfile", "NodeImageVersion", - "NodeImageVersionsListResult", - "OperationListResult", "OperationStatusResult", - "OperationStatusResultList", "OperationValue", + "OperationValueDisplay", "OutboundEnvironmentEndpoint", - "OutboundEnvironmentEndpointCollection", "PortRange", "PowerState", "PrivateEndpoint", "PrivateEndpointConnection", "PrivateEndpointConnectionListResult", + "PrivateEndpointConnectionProperties", "PrivateLinkResource", "PrivateLinkResourcesListResult", "PrivateLinkServiceConnectionState", @@ -568,7 +553,6 @@ "RunCommandRequest", "RunCommandResult", "SafeguardsAvailableVersion", - "SafeguardsAvailableVersionsList", "SafeguardsAvailableVersionsProperties", "ScaleProfile", "Schedule", @@ -577,8 +561,7 @@ "SchedulerProfileSchedulerInstanceProfiles", "ServiceMeshProfile", "Snapshot", - "SnapshotListResult", - "SubResource", + "SnapshotProperties", "SysctlConfig", "SystemData", "TagsObject", @@ -587,8 +570,7 @@ "TrackedResource", "TrustedAccessRole", "TrustedAccessRoleBinding", - "TrustedAccessRoleBindingListResult", - "TrustedAccessRoleListResult", + "TrustedAccessRoleBindingProperties", "TrustedAccessRoleRule", "UpgradeOverrideSettings", "UserAssignedIdentity", diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_container_service_client_enums.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_enums.py similarity index 84% rename from sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_container_service_client_enums.py rename to sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_enums.py index d4b6bc059e38..c68ae4a3a8df 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_container_service_client_enums.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_enums.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -15,7 +15,8 @@ class AccelerationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enable advanced network acceleration options. This allows users to configure acceleration using BPF host routing. This can be enabled only with Cilium dataplane. If not specified, the default value is None (no acceleration). The acceleration mode can be changed on a pre-existing - cluster. See https://aka.ms/acnsperformance for a detailed explanation. + cluster. See `https://aka.ms/acnsperformance `_ for a detailed + explanation. """ BPF_VETH = "BpfVeth" @@ -49,24 +50,26 @@ class AdoptionPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): class AdvancedNetworkPolicies(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enable advanced network policies. This allows users to configure Layer 7 network policies (FQDN, HTTP, Kafka). Policies themselves must be configured via the Cilium Network Policy - resources, see https://docs.cilium.io/en/latest/security/policy/index.html. This can be enabled - only on cilium-based clusters. If not specified, the default value is FQDN if security.enabled - is set to true. + resources, see `https://docs.cilium.io/en/latest/security/policy/index.html + `_. This can be enabled only on + cilium-based clusters. If not specified, the default value is FQDN if security.enabled is set + to true. """ L7 = "L7" """Enable Layer7 network policies (FQDN, HTTP/S, Kafka). This option is a superset of the FQDN option.""" FQDN = "FQDN" - """Enable FQDN based network policies""" + """Enable FQDN based network policies.""" NONE = "None" - """Disable Layer 7 network policies (FQDN, HTTP/S, Kafka)""" + """Disable Layer 7 network policies (FQDN, HTTP/S, Kafka).""" class AgentPoolMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The mode of an agent pool. 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. + `https://docs.microsoft.com/azure/aks/use-system-pools + `_. """ SYSTEM = "System" @@ -77,7 +80,7 @@ class AgentPoolMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """User agent pools are primarily for hosting your application pods.""" GATEWAY = "Gateway" """Gateway agent pools are dedicated to providing static egress IPs to pods. For more details, see - https://aka.ms/aks/static-egress-gateway.""" + `https://aka.ms/aks/static-egress-gateway `_.""" MANAGED_SYSTEM = "ManagedSystem" """ManagedSystem is a system pool managed by AKS. The pool scales dynamically according to cluster usage, and has additional automated monitoring and healing capabilities. There can only be one @@ -95,11 +98,10 @@ class AgentPoolSSHAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): LOCAL_USER = "LocalUser" """Can SSH onto the node as a local user using private key.""" DISABLED = "Disabled" - """SSH service will be turned off on the node. More information can be found under - https://aka.ms/aks/ssh/disable""" + """SSH service will be turned off on the node.""" ENTRA_ID = "EntraId" """SSH to node with EntraId integration. More information can be found under - https://aka.ms/aks/ssh/aad""" + `https://aka.ms/aks/ssh/aad `_.""" class AgentPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -117,9 +119,9 @@ class ArtifactSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The artifact source. The source where the artifacts are downloaded from.""" CACHE = "Cache" - """pull images from Azure Container Registry with cache""" + """pull images from Azure Container Registry with cache.""" DIRECT = "Direct" - """pull images from Microsoft Artifact Registry""" + """pull images from Microsoft Artifact Registry.""" class BackendPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -127,13 +129,17 @@ class BackendPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta): 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.""" + `https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend + `_.""" NODE_IP = "NodeIP" """The type of the managed inbound Load Balancer BackendPool. - https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend.""" + `https://cloud-provider-azure.sigs.k8s.io/topics/loadbalancer/#configure-load-balancer-backend + `_.""" -class ClusterServiceLoadBalancerHealthProbeMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ClusterServiceLoadBalancerHealthProbeMode( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The health probing behavior for External Traffic Policy Cluster services.""" SERVICE_NODE_PORT = "ServiceNodePort" @@ -157,18 +163,26 @@ class ConnectionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The private link service connection status.""" PENDING = "Pending" + """Connection is pending approval.""" APPROVED = "Approved" + """Connection is approved.""" REJECTED = "Rejected" + """Connection is rejected.""" DISCONNECTED = "Disconnected" + """Connection is disconnected.""" class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that created the resource.""" + """The kind of entity that created the resource.""" USER = "User" + """The entity was created by a user.""" APPLICATION = "Application" + """The entity was created by an application.""" MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" KEY = "Key" + """The entity was created by a key.""" class DeletePolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -235,17 +249,16 @@ class ExtendedLocationTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of extendedLocation.""" EDGE_ZONE = "EdgeZone" + """Azure Edge Zone extended location type.""" class Format(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Format.""" + """The format of the kubeconfig credential.""" AZURE = "azure" """Return azure auth-provider kubeconfig. This format is deprecated in v1.22 and will be fully - removed in v1.26. See: https://aka.ms/k8s/changes-1-26.""" - EXEC = "exec" - """Return exec format kubeconfig. This format requires kubelogin binary in the path.""" - EXEC_ENUM = "exec" + removed in v1.26. See: `https://aka.ms/k8s/changes-1-26 `_.""" + EXECEnum = "exec" """Return exec format kubeconfig. This format requires kubelogin binary in the path.""" @@ -262,10 +275,15 @@ class GPUInstanceProfile(str, Enum, metaclass=CaseInsensitiveEnumMeta): """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.""" MIG1_G = "MIG1g" + """MIG 1g GPU instance profile.""" MIG2_G = "MIG2g" + """MIG 2g GPU instance profile.""" MIG3_G = "MIG3g" + """MIG 3g GPU instance profile.""" MIG4_G = "MIG4g" + """MIG 4g GPU instance profile.""" MIG7_G = "MIG7g" + """MIG 7g GPU instance profile.""" class GuardrailsSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -298,35 +316,39 @@ class IdentityBindingProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumM class InfrastructureEncryption(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Whether to enable encryption at rest of Kubernetes resource objects using service-managed keys. More information on this can be found under - https://aka.ms/aks/kubernetesResourceObjectEncryption. + `https://aka.ms/aks/kubernetesResourceObjectEncryption + `_. """ ENABLED = "Enabled" """Encryption at rest of Kubernetes resource objects using service-managed keys is enabled. More - information on this can be found under https://aka.ms/aks/kubernetesResourceObjectEncryption.""" + information on this can be found under `https://aka.ms/aks/kubernetesResourceObjectEncryption + `_.""" DISABLED = "Disabled" """Encryption at rest of Kubernetes resource objects using service-managed keys is disabled. More - information on this can be found under https://aka.ms/aks/kubernetesResourceObjectEncryption.""" + information on this can be found under `https://aka.ms/aks/kubernetesResourceObjectEncryption + `_.""" class IPFamily(str, Enum, metaclass=CaseInsensitiveEnumMeta): """To determine if address belongs IPv4 or IPv6 family.""" I_PV4 = "IPv4" - """IPv4 family""" + """IPv4 family.""" I_PV6 = "IPv6" - """IPv6 family""" + """IPv6 family.""" class IpvsScheduler(str, Enum, metaclass=CaseInsensitiveEnumMeta): """IPVS scheduler, for more information please see - http://www.linuxvirtualserver.org/docs/scheduling.html. + `http://www.linuxvirtualserver.org/docs/scheduling.html + `_. """ ROUND_ROBIN = "RoundRobin" - """Round Robin""" + """Round Robin.""" LEAST_CONNECTION = "LeastConnection" - """Least Connection""" + """Least Connection.""" class IstioIngressGatewayMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -363,7 +385,9 @@ class KeyVaultNetworkAccessTypes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ PUBLIC = "Public" + """Key vault allows public access from all networks.""" PRIVATE = "Private" + """Key vault disables public access and enables private link.""" class KubeletDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -496,15 +520,23 @@ class LocalDNSState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """localDNS is disabled.""" -class ManagedClusterPodIdentityProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ManagedClusterPodIdentityProvisioningState( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The current provisioning state of the pod identity.""" ASSIGNED = "Assigned" + """Pod identity is assigned.""" CANCELED = "Canceled" + """Pod identity assignment was canceled.""" DELETING = "Deleting" + """Pod identity is being deleted.""" FAILED = "Failed" + """Pod identity assignment failed.""" SUCCEEDED = "Succeeded" + """Pod identity assignment succeeded.""" UPDATING = "Updating" + """Pod identity is being updated.""" class ManagedClusterSKUName(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -539,7 +571,8 @@ class ManagedClusterSKUTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): class ManagedGatewayType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Configuration for the managed Gateway API installation. If not specified, the default is - 'Disabled'. See https://aka.ms/k8s-gateway-api for more details. + 'Disabled'. See `https://aka.ms/k8s-gateway-api `_ for more + details. """ DISABLED = "Disabled" @@ -547,7 +580,8 @@ class ManagedGatewayType(str, Enum, metaclass=CaseInsensitiveEnumMeta): STANDARD = "Standard" """The latest Gateway CRD bundle from the standard channel that is compatible with your Kubernetes version will be reconciled onto your cluster. See - https://gateway-api.sigs.k8s.io/concepts/versioning/ for more details.""" + `https://gateway-api.sigs.k8s.io/concepts/versioning/ + `_ for more details.""" class MeshMembershipProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -571,7 +605,7 @@ class Mode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specify which proxy mode to use ('IPTABLES', 'IPVS' or 'NFTABLES').""" IPTABLES = "IPTABLES" - """IPTables proxy mode""" + """IPTables proxy mode.""" IPVS = "IPVS" """IPVS proxy mode. Must be using Kubernetes version >= 1.22.""" NFTABLES = "NFTABLES" @@ -582,11 +616,17 @@ class NamespaceProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The current provisioning state of the namespace.""" UPDATING = "Updating" + """The namespace is being updated.""" DELETING = "Deleting" + """The namespace is being deleted.""" CREATING = "Creating" + """The namespace is being created.""" SUCCEEDED = "Succeeded" + """The namespace provisioning succeeded.""" FAILED = "Failed" + """The namespace provisioning failed.""" CANCELED = "Canceled" + """The namespace provisioning was canceled.""" class NetworkDataplane(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -609,7 +649,7 @@ class NetworkMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): CNI. See `Transparent Mode `_ for more information.""" BRIDGE = "bridge" - """This is no longer supported""" + """This is no longer supported.""" class NetworkPlugin(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -624,16 +664,17 @@ class NetworkPlugin(str, Enum, metaclass=CaseInsensitiveEnumMeta): `_ for more information.""" NONE = "none" - """Do not use a network plugin. A custom CNI will need to be installed after cluster creation for - networking functionality.""" + """No CNI plugin is pre-installed. See `BYO CNI + `_ for more information.""" class NetworkPluginMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The mode the network plugin should use.""" OVERLAY = "overlay" - """Pods are given IPs from the PodCIDR address space but use Azure Routing Domains rather than - Kubenet reference plugins host-local and bridge.""" + """Used with networkPlugin=azure, pods are given IPs from the PodCIDR address space but use Azure + Routing Domains rather than Kubenet's method of route tables. For more information visit + `https://aka.ms/aks/azure-cni-overlay `_.""" class NetworkPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -675,20 +716,25 @@ class NginxIngressControllerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class NodeOSUpgradeChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Manner in which the OS on your nodes is updated. The default is Unmanaged, but may change to - either NodeImage or SecurityPatch at GA. + """Node OS Upgrade Channel. Manner in which the OS on your nodes is updated. The default is + NodeImage. """ NONE = "None" """No attempt to update your machines OS will be made either by OS or by rolling VHDs. This means - you are responsible for your security updates""" + you are responsible for your security updates.""" UNMANAGED = "Unmanaged" """OS updates will be applied automatically through the OS built-in patching infrastructure. Newly - scaled in machines will be unpatched initially, and will be patched at some later time by the - OS's infrastructure. Behavior of this option depends on the OS in question. Ubuntu and Mariner - apply security patches through unattended upgrade roughly once a day around 06:00 UTC. Windows - does not apply security patches automatically and so for them this option is equivalent to None - till further notice""" + scaled in machines will be unpatched initially and will be patched at some point by the OS's + infrastructure. Behavior of this option depends on the OS in question. Ubuntu and Mariner apply + security patches through unattended upgrade roughly once a day around 06:00 UTC. Windows does + not apply security patches automatically and so for them this option is equivalent to None till + further notice.""" + NODE_IMAGE = "NodeImage" + """AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a + weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following + maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option + as AKS hosts the images.""" SECURITY_PATCH = "SecurityPatch" """AKS downloads and updates the nodes with tested security updates. These updates honor the maintenance window settings and produce a new VHD that is used on new nodes. On some occasions @@ -696,11 +742,6 @@ class NodeOSUpgradeChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): re-imaged to the newly produced VHD in order to apply the changes. This option incurs an extra cost of hosting the new Security Patch VHDs in your resource group for just in time consumption.""" - NODE_IMAGE = "NodeImage" - """AKS will update the nodes with a newly patched VHD containing security fixes and bugfixes on a - weekly cadence. With the VHD update machines will be rolling reimaged to that VHD following - maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option - as AKS hosts the images.""" class NodeProvisioningDefaultNodePools(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -716,14 +757,14 @@ class NodeProvisioningDefaultNodePools(str, Enum, metaclass=CaseInsensitiveEnumM """No Karpenter NodePools are provisioned automatically. Automatic scaling will not happen unless the user creates one or more NodePool CRD instances.""" AUTO = "Auto" - """A standard set of Karpenter NodePools are provisioned""" + """A standard set of Karpenter NodePools are provisioned.""" class NodeProvisioningMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The node provisioning mode. If not specified, the default is Manual.""" MANUAL = "Manual" - """Nodes are provisioned manually by the user""" + """Nodes are provisioned manually by the user.""" AUTO = "Auto" """Nodes are provisioned automatically by AKS using Karpenter (See aka.ms/aks/nap for more details). Fixed size Node Pools can still be created, but autoscaling Node Pools cannot be. @@ -733,7 +774,7 @@ class NodeProvisioningMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): class Operator(str, Enum, metaclass=CaseInsensitiveEnumMeta): """operator represents a key's relationship to a set of values. Valid operators are In and NotIn.""" - IN = "In" + INEnum = "In" """The value of the key should be in the given list.""" NOT_IN = "NotIn" """The value of the key should not be in the given list.""" @@ -741,8 +782,6 @@ class Operator(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The value of the key should exist.""" DOES_NOT_EXIST = "DoesNotExist" """The value of the key should not exist.""" - IN_ENUM = "In" - """The value of the key should be in the given list.""" class OSDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -763,28 +802,30 @@ class OSDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta): 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. + """Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The + default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType + is Windows. """ UBUNTU = "Ubuntu" """Use Ubuntu as the OS for node images.""" - MARINER = "Mariner" - """Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead.""" AZURE_LINUX = "AzureLinux" """Use AzureLinux as the OS for node images. Azure Linux is a container-optimized Linux distro - built by Microsoft, visit https://aka.ms/azurelinux for more information.""" + built by Microsoft, visit `https://aka.ms/azurelinux `_ for more + information.""" AZURE_LINUX3 = "AzureLinux3" """Use AzureLinux3 as the OS for node images. Azure Linux is a container-optimized Linux distro - built by Microsoft, visit https://aka.ms/azurelinux for more information. For limitations, - visit https://aka.ms/aks/node-images. For OS migration guidance, see - https://aka.ms/aks/upgrade-os-version.""" + built by Microsoft, visit `https://aka.ms/azurelinux `_ for more + information. For limitations, visit `https://aka.ms/aks/node-images + `_. For OS migration guidance, see + `https://aka.ms/aks/upgrade-os-version `_.""" + MARINER = "Mariner" + """Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead.""" FLATCAR = "Flatcar" """Use Flatcar Container Linux as the OS for node images. Flatcar is a container-optimized, security-focused Linux OS, with an immutable filesystem and part of the Cloud Native Computing Foundation (CNCF). For more information about Flatcar Container Linux for AKS, see - aka.ms/aks/flatcar-container-linux-for-aks""" + aka.ms/aks/flatcar-container-linux-for-aks.""" CBL_MARINER = "CBLMariner" """Deprecated OSSKU. Microsoft recommends that new deployments choose 'AzureLinux' instead.""" WINDOWS2019 = "Windows2019" @@ -793,6 +834,10 @@ class OSSKU(str, Enum, metaclass=CaseInsensitiveEnumMeta): WINDOWS2022 = "Windows2022" """Use Windows2022 as the OS for node images. Unsupported for system node pools. Windows2022 only supports Windows2022 containers; it cannot run Windows2019 containers and vice versa.""" + UBUNTU2204 = "Ubuntu2204" + """Use Ubuntu2204 as the OS for node images, however, Ubuntu 22.04 may not be supported for all + nodepools. For limitations and supported kubernetes versions, see + `https://aka.ms/aks/supported-ubuntu-versions `_.""" WINDOWS2025 = "Windows2025" """Use Windows2025 as the OS for node images. Unsupported for system node pools. Windows2025 supports Windows2022 and Windows 2025 containers; it cannot run Windows2019 containers and vice @@ -800,15 +845,12 @@ class OSSKU(str, Enum, metaclass=CaseInsensitiveEnumMeta): WINDOWS_ANNUAL = "WindowsAnnual" """Use Windows Annual Channel version as the OS for node images. Unsupported for system node pools. Details about supported container images and kubernetes versions under different AKS - Annual Channel versions could be seen in https://aka.ms/aks/windows-annual-channel-details.""" - UBUNTU2204 = "Ubuntu2204" - """Use Ubuntu2204 as the OS for node images, however, Ubuntu 22.04 may not be supported for all - nodepools. For limitations and supported kubernetes versions, see see - https://aka.ms/aks/supported-ubuntu-versions""" + Annual Channel versions could be seen in `https://aka.ms/aks/windows-annual-channel-details + `_.""" UBUNTU2404 = "Ubuntu2404" """Use Ubuntu2404 as the OS for node images, however, Ubuntu 24.04 may not be supported for all nodepools. For limitations and supported kubernetes versions, see see - https://aka.ms/aks/supported-ubuntu-versions""" + `https://aka.ms/aks/supported-ubuntu-versions `_.""" class OSType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -843,7 +885,8 @@ class OutboundType(str, Enum, metaclass=CaseInsensitiveEnumMeta): NONE = "none" """The AKS cluster is not set with any outbound-type. All AKS nodes follows Azure VM default outbound behavior. Please refer to - https://azure.microsoft.com/en-us/updates/default-outbound-access-for-vms-in-azure-will-be-retired-transition-to-a-new-method-of-internet-access/""" + `https://azure.microsoft.com/en-us/updates/default-outbound-access-for-vms-in-azure-will-be-retired-transition-to-a-new-method-of-internet-access/ + `_.""" class PodIPAllocationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -855,13 +898,13 @@ class PodIPAllocationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Each node gets allocated with a non-contiguous list of IP addresses assignable to pods. This is better for maximizing a small to medium subnet of size /16 or smaller. The Azure CNI cluster with dynamic IP allocation defaults to this mode if the customer does not explicitly specify a - podIPAllocationMode""" + podIPAllocationMode.""" STATIC_BLOCK = "StaticBlock" """Each node is statically allocated CIDR block(s) of size /28 = 16 IPs per block to satisfy the maxPods per node. Number of CIDR blocks >= (maxPods / 16). The block, rather than a single IP, counts against the Azure Vnet Private IP limit of 65K. Therefore block mode is suitable for running larger workloads with more than the current limit of 65K pods in a cluster. This mode - is better suited to scale with larger subnets of /15 or bigger""" + is better suited to scale with larger subnets of /15 or bigger.""" class PodLinkLocalAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -887,14 +930,21 @@ class PolicyRule(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Allow traffic within the same namespace.""" -class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class PrivateEndpointConnectionProvisioningState( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The current provisioning state.""" CANCELED = "Canceled" + """Private endpoint connection provisioning was canceled.""" CREATING = "Creating" + """Private endpoint connection is being created.""" DELETING = "Deleting" + """Private endpoint connection is being deleted.""" FAILED = "Failed" + """Private endpoint connection provisioning failed.""" SUCCEEDED = "Succeeded" + """Private endpoint connection provisioning succeeded.""" class Protocol(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -945,12 +995,14 @@ class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class RestrictionLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The restriction level applied to the cluster's node resource group.""" + """The restriction level applied to the cluster's node resource group. If not specified, the + default is 'Unrestricted'. + """ UNRESTRICTED = "Unrestricted" - """All RBAC permissions are allowed on the managed node resource group""" + """All RBAC permissions are allowed on the managed node resource group.""" READ_ONLY = "ReadOnly" - """Only */read RBAC permissions allowed on the managed node resource group""" + """Only \\*\\/read RBAC permissions allowed on the managed node resource group.""" class SafeguardsSupport(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1046,37 +1098,43 @@ class TransitEncryptionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): WIRE_GUARD = "WireGuard" """Enable WireGuard encryption. Refer to - https://docs.cilium.io/en/latest/security/network/encryption-wireguard/ on use cases and - implementation details""" + `https://docs.cilium.io/en/latest/security/network/encryption-wireguard/ + `_ on use cases and + implementation details.""" NONE = "None" - """Disable Transit encryption""" + """Disable Transit encryption.""" -class TrustedAccessRoleBindingProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class TrustedAccessRoleBindingProvisioningState( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The current provisioning state of trusted access role binding.""" CANCELED = "Canceled" + """Trusted access role binding provisioning was canceled.""" DELETING = "Deleting" + """Trusted access role binding is being deleted.""" FAILED = "Failed" + """Trusted access role binding provisioning failed.""" SUCCEEDED = "Succeeded" + """Trusted access role binding provisioning succeeded.""" UPDATING = "Updating" + """Trusted access role binding is being updated.""" class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The week index. Specifies on which instance of the allowed days specified in daysOfWeek the - maintenance occurs. - """ + """The week index. Specifies on which week of the month the dayOfWeek applies.""" FIRST = "First" - """First.""" + """First week of the month.""" SECOND = "Second" - """Second.""" + """Second week of the month.""" THIRD = "Third" - """Third.""" + """Third week of the month.""" FOURTH = "Fourth" - """Fourth.""" + """Fourth week of the month.""" LAST = "Last" - """Last.""" + """Last week of the month.""" class UndrainableNodeBehavior(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1126,7 +1184,7 @@ class UpgradeChannel(str, Enum, metaclass=CaseInsensitiveEnumMeta): NODE_IMAGE = "node-image" """Automatically upgrade the node image to the latest version available. Consider using nodeOSUpgradeChannel instead as that allows you to configure node OS patching separate from - Kubernetes version patching""" + Kubernetes version patching.""" NONE = "none" """Disables auto-upgrades and keeps the cluster at its current version of Kubernetes.""" @@ -1154,12 +1212,19 @@ class WeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The weekday enum.""" SUNDAY = "Sunday" + """Represents Sunday.""" MONDAY = "Monday" + """Represents Monday.""" TUESDAY = "Tuesday" + """Represents Tuesday.""" WEDNESDAY = "Wednesday" + """Represents Wednesday.""" THURSDAY = "Thursday" + """Represents Thursday.""" FRIDAY = "Friday" + """Represents Friday.""" SATURDAY = "Saturday" + """Represents Saturday.""" class WorkloadRuntime(str, Enum, metaclass=CaseInsensitiveEnumMeta): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_models.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_models.py new file mode 100644 index 000000000000..88e4c3c24cd7 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_models.py @@ -0,0 +1,12579 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class AbsoluteMonthlySchedule(_Model): + """For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. + + :ivar interval_months: Specifies the number of months between each set of occurrences. + Required. + :vartype interval_months: int + :ivar day_of_month: The date of the month. Required. + :vartype day_of_month: int + """ + + interval_months: int = rest_field(name="intervalMonths", visibility=["read", "create", "update", "delete", "query"]) + """Specifies the number of months between each set of occurrences. Required.""" + day_of_month: int = rest_field(name="dayOfMonth", visibility=["read", "create", "update", "delete", "query"]) + """The date of the month. Required.""" + + @overload + def __init__( + self, + *, + interval_months: int, + day_of_month: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AccessProfile(_Model): + """Profile for enabling a user to access a managed cluster. + + :ivar kube_config: Base64-encoded Kubernetes configuration file. + :vartype kube_config: bytes + """ + + kube_config: Optional[bytes] = rest_field( + name="kubeConfig", visibility=["read", "create", "update", "delete", "query"], format="base64" + ) + """Base64-encoded Kubernetes configuration file.""" + + @overload + def __init__( + self, + *, + kube_config: Optional[bytes] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AdvancedNetworking(_Model): + """Advanced Networking profile for enabling observability and security feature suite on a cluster. + For more information see aka.ms/aksadvancednetworking. + + :ivar enabled: Indicates the enablement of Advanced Networking functionalities of observability + and security on AKS clusters. When this is set to true, all observability and security features + will be set to enabled unless explicitly disabled. If not specified, the default is false. + :vartype enabled: bool + :ivar observability: Observability profile to enable advanced network metrics and flow logs + with historical contexts. + :vartype observability: ~azure.mgmt.containerservice.models.AdvancedNetworkingObservability + :ivar security: Security profile to enable security features on cilium based cluster. + :vartype security: ~azure.mgmt.containerservice.models.AdvancedNetworkingSecurity + :ivar performance: Profile to enable performance-enhancing features on clusters that use Azure + CNI powered by Cilium. + :vartype performance: ~azure.mgmt.containerservice.models.AdvancedNetworkingPerformance + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates the enablement of Advanced Networking functionalities of observability and security + on AKS clusters. When this is set to true, all observability and security features will be set + to enabled unless explicitly disabled. If not specified, the default is false.""" + observability: Optional["_models.AdvancedNetworkingObservability"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Observability profile to enable advanced network metrics and flow logs with historical + contexts.""" + security: Optional["_models.AdvancedNetworkingSecurity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Security profile to enable security features on cilium based cluster.""" + performance: Optional["_models.AdvancedNetworkingPerformance"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Profile to enable performance-enhancing features on clusters that use Azure CNI powered by + Cilium.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + observability: Optional["_models.AdvancedNetworkingObservability"] = None, + security: Optional["_models.AdvancedNetworkingSecurity"] = None, + performance: Optional["_models.AdvancedNetworkingPerformance"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AdvancedNetworkingObservability(_Model): + """Observability profile to enable advanced network metrics and flow logs with historical + contexts. + + :ivar enabled: Indicates the enablement of Advanced Networking observability functionalities on + clusters. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates the enablement of Advanced Networking observability functionalities on clusters.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AdvancedNetworkingPerformance(_Model): + """Profile to enable performance-enhancing features on clusters that use Azure CNI powered by + Cilium. + + :ivar acceleration_mode: Enable advanced network acceleration options. This allows users to + configure acceleration using BPF host routing. This can be enabled only with Cilium dataplane. + If not specified, the default value is None (no acceleration). The acceleration mode can be + changed on a pre-existing cluster. See `https://aka.ms/acnsperformance + `_ for a detailed explanation. Known values are: "BpfVeth" and + "None". + :vartype acceleration_mode: str or ~azure.mgmt.containerservice.models.AccelerationMode + """ + + acceleration_mode: Optional[Union[str, "_models.AccelerationMode"]] = rest_field( + name="accelerationMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Enable advanced network acceleration options. This allows users to configure acceleration using + BPF host routing. This can be enabled only with Cilium dataplane. If not specified, the default + value is None (no acceleration). The acceleration mode can be changed on a pre-existing + cluster. See `https://aka.ms/acnsperformance `_ for a detailed + explanation. Known values are: \"BpfVeth\" and \"None\".""" + + @overload + def __init__( + self, + *, + acceleration_mode: Optional[Union[str, "_models.AccelerationMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AdvancedNetworkingSecurity(_Model): + """Security profile to enable security features on cilium based cluster. + + :ivar enabled: This feature allows user to configure network policy based on DNS (FQDN) names. + It can be enabled only on cilium based clusters. If not specified, the default is false. + :vartype enabled: bool + :ivar advanced_network_policies: Enable advanced network policies. This allows users to + configure Layer 7 network policies (FQDN, HTTP, Kafka). Policies themselves must be configured + via the Cilium Network Policy resources, see + `https://docs.cilium.io/en/latest/security/policy/index.html + `_. This can be enabled only on + cilium-based clusters. If not specified, the default value is FQDN if security.enabled is set + to true. Known values are: "L7", "FQDN", and "None". + :vartype advanced_network_policies: str or + ~azure.mgmt.containerservice.models.AdvancedNetworkPolicies + :ivar transit_encryption: Encryption configuration for Cilium-based clusters. Once enabled all + traffic between Cilium managed pods will be encrypted when it leaves the node boundary. + :vartype transit_encryption: + ~azure.mgmt.containerservice.models.AdvancedNetworkingSecurityTransitEncryption + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """This feature allows user to configure network policy based on DNS (FQDN) names. It can be + enabled only on cilium based clusters. If not specified, the default is false.""" + advanced_network_policies: Optional[Union[str, "_models.AdvancedNetworkPolicies"]] = rest_field( + name="advancedNetworkPolicies", visibility=["read", "create", "update", "delete", "query"] + ) + """Enable advanced network policies. This allows users to configure Layer 7 network policies + (FQDN, HTTP, Kafka). Policies themselves must be configured via the Cilium Network Policy + resources, see `https://docs.cilium.io/en/latest/security/policy/index.html + `_. This can be enabled only on + cilium-based clusters. If not specified, the default value is FQDN if security.enabled is set + to true. Known values are: \"L7\", \"FQDN\", and \"None\".""" + transit_encryption: Optional["_models.AdvancedNetworkingSecurityTransitEncryption"] = rest_field( + name="transitEncryption", visibility=["read", "create", "update", "delete", "query"] + ) + """Encryption configuration for Cilium-based clusters. Once enabled all traffic between Cilium + managed pods will be encrypted when it leaves the node boundary.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + advanced_network_policies: Optional[Union[str, "_models.AdvancedNetworkPolicies"]] = None, + transit_encryption: Optional["_models.AdvancedNetworkingSecurityTransitEncryption"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AdvancedNetworkingSecurityTransitEncryption(_Model): # pylint: disable=name-too-long + """Encryption configuration for Cilium-based clusters. Once enabled all traffic between Cilium + managed pods will be encrypted when it leaves the node boundary. + + :ivar type: Configures pod-to-pod encryption. This can be enabled only on Cilium-based + clusters. If not specified, the default value is None. Known values are: "WireGuard" and + "None". + :vartype type: str or ~azure.mgmt.containerservice.models.TransitEncryptionType + """ + + type: Optional[Union[str, "_models.TransitEncryptionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configures pod-to-pod encryption. This can be enabled only on Cilium-based clusters. If not + specified, the default value is None. Known values are: \"WireGuard\" and \"None\".""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.TransitEncryptionType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Resource(_Model): + """Resource. + + :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.models.SystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :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.models.SystemData + """ + + +class AgentPool(ProxyResource): + """Agent Pool. + + :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.models.SystemData + :ivar properties: Properties of an agent pool. + :vartype properties: + ~azure.mgmt.containerservice.models.ManagedClusterAgentPoolProfileProperties + """ + + properties: Optional["_models.ManagedClusterAgentPoolProfileProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of an agent pool.""" + + __flattened_items = [ + "e_tag", + "count", + "vm_size", + "os_disk_size_gb", + "os_disk_type", + "kubelet_disk_type", + "workload_runtime", + "message_of_the_day", + "vnet_subnet_id", + "pod_subnet_id", + "pod_ip_allocation_mode", + "max_pods", + "os_type", + "os_sku", + "max_count", + "min_count", + "enable_auto_scaling", + "scale_down_mode", + "type", + "mode", + "orchestrator_version", + "current_orchestrator_version", + "node_image_version", + "upgrade_strategy", + "upgrade_settings", + "upgrade_settings_blue_green", + "provisioning_state", + "power_state", + "availability_zones", + "enable_node_public_ip", + "node_public_ip_prefix_id", + "scale_set_priority", + "scale_set_eviction_policy", + "spot_max_price", + "tags", + "node_labels", + "node_taints", + "node_initialization_taints", + "proximity_placement_group_id", + "kubelet_config", + "linux_os_config", + "enable_encryption_at_host", + "enable_ultra_ssd", + "enable_fips", + "gpu_instance_profile", + "creation_data", + "capacity_reservation_group_id", + "host_group_id", + "network_profile", + "windows_profile", + "security_profile", + "gpu_profile", + "gateway_profile", + "artifact_streaming_profile", + "virtual_machines_profile", + "virtual_machine_nodes_status", + "status", + "local_dns_profile", + "node_customization_profile", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedClusterAgentPoolProfileProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class AgentPoolArtifactStreamingProfile(_Model): + """Artifact streaming profile for the agent pool. + + :ivar enabled: Artifact streaming speeds up the cold-start of containers on a node through + on-demand image loading. To use this feature, container images must also enable artifact + streaming on ACR. If not specified, the default is false. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Artifact streaming speeds up the cold-start of containers on a node through on-demand image + loading. To use this feature, container images must also enable artifact streaming on ACR. If + not specified, the default is false.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolAvailableVersions(_Model): + """The list of available versions for an agent pool. + + :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 properties: Properties of agent pool available versions. Required. + :vartype properties: ~azure.mgmt.containerservice.models.AgentPoolAvailableVersionsProperties + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """The ID of the agent pool version list.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the agent pool version list.""" + type: Optional[str] = rest_field(visibility=["read"]) + """Type of the agent pool version list.""" + properties: "_models.AgentPoolAvailableVersionsProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of agent pool available versions. Required.""" + + __flattened_items = ["agent_pool_versions"] + + @overload + def __init__( + self, + *, + properties: "_models.AgentPoolAvailableVersionsProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class AgentPoolAvailableVersionsProperties(_Model): + """The list of available agent pool versions. + + :ivar agent_pool_versions: List of versions available for agent pool. + :vartype agent_pool_versions: + list[~azure.mgmt.containerservice.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] + """ + + agent_pool_versions: Optional[list["_models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = ( + rest_field(name="agentPoolVersions", visibility=["read", "create", "update", "delete", "query"]) + ) + """List of versions available for agent pool.""" + + @overload + def __init__( + self, + *, + agent_pool_versions: Optional[list["_models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(_Model): # pylint: disable=name-too-long + """Available version information for an agent pool. + + :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 + """ + + default: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether this version is the default agent pool version.""" + kubernetes_version: Optional[str] = rest_field( + name="kubernetesVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The Kubernetes version (major.minor.patch).""" + is_preview: Optional[bool] = rest_field( + name="isPreview", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether Kubernetes version is currently in preview.""" + + @overload + def __init__( + self, + *, + default: Optional[bool] = None, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolBlueGreenUpgradeSettings(_Model): + """Settings for blue-green upgrade on an agentpool. + + :ivar drain_batch_size: The number or percentage of nodes to drain in batch during blue-green + upgrade. Must be a non-zero number. 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 number + of blue nodes of the initial upgrade operation. For percentages, fractional nodes are rounded + up. If not specified, the default is 10%. For more information, including best practices, see: + `https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster + `_. + :vartype drain_batch_size: str + :ivar drain_timeout_in_minutes: The drain timeout for a node, i.e., the amount of time (in + minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time + honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not + specified, the default is 30 minutes. + :vartype drain_timeout_in_minutes: int + :ivar batch_soak_duration_in_minutes: The soak duration after draining a batch of nodes, i.e., + the amount of time (in minutes) to wait after draining a batch of nodes before moving on the + next batch. If not specified, the default is 15 minutes. + :vartype batch_soak_duration_in_minutes: int + :ivar final_soak_duration_in_minutes: The soak duration for a node pool, i.e., the amount of + time (in minutes) to wait after all old nodes are drained before we remove the old nodes. If + not specified, the default is 60 minutes. Only applicable for blue-green upgrade strategy. + :vartype final_soak_duration_in_minutes: int + """ + + drain_batch_size: Optional[str] = rest_field( + name="drainBatchSize", visibility=["read", "create", "update", "delete", "query"] + ) + """The number or percentage of nodes to drain in batch during blue-green upgrade. Must be a + non-zero number. 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 number of blue nodes of the + initial upgrade operation. For percentages, fractional nodes are rounded up. If not specified, + the default is 10%. For more information, including best practices, see: + `https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster + `_.""" + drain_timeout_in_minutes: Optional[int] = rest_field( + name="drainTimeoutInMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """The drain timeout for a node, i.e., the amount of time (in minutes) to wait on eviction of pods + and graceful termination per node. This eviction wait time honors waiting on pod disruption + budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 + minutes.""" + batch_soak_duration_in_minutes: Optional[int] = rest_field( + name="batchSoakDurationInMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """The soak duration after draining a batch of nodes, i.e., the amount of time (in minutes) to + wait after draining a batch of nodes before moving on the next batch. If not specified, the + default is 15 minutes.""" + final_soak_duration_in_minutes: Optional[int] = rest_field( + name="finalSoakDurationInMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """The soak duration for a node pool, i.e., the amount of time (in minutes) to wait after all old + nodes are drained before we remove the old nodes. If not specified, the default is 60 minutes. + Only applicable for blue-green upgrade strategy.""" + + @overload + def __init__( + self, + *, + drain_batch_size: Optional[str] = None, + drain_timeout_in_minutes: Optional[int] = None, + batch_soak_duration_in_minutes: Optional[int] = None, + final_soak_duration_in_minutes: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolDeleteMachinesParameter(_Model): + """Specifies a list of machine names from the agent pool to be deleted. + + :ivar machine_names: The agent pool machine names. Required. + :vartype machine_names: list[str] + """ + + machine_names: list[str] = rest_field( + name="machineNames", visibility=["read", "create", "update", "delete", "query"] + ) + """The agent pool machine names. Required.""" + + @overload + def __init__( + self, + *, + machine_names: list[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolGatewayProfile(_Model): + """Profile of the managed cluster gateway agent pool. + + :ivar public_ip_prefix_size: The Gateway agent pool associates one public IPPrefix for each + static egress gateway to provide public egress. The size of Public IPPrefix should be selected + by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The + IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public + IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 + nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. + :vartype public_ip_prefix_size: int + """ + + public_ip_prefix_size: Optional[int] = rest_field( + name="publicIPPrefixSize", visibility=["read", "create", "update", "delete", "query"] + ) + """The Gateway agent pool associates one public IPPrefix for each static egress gateway to provide + public egress. The size of Public IPPrefix should be selected by the user. Each node in the + agent pool is assigned with one IP from the IPPrefix. The IPPrefix size thus serves as a cap on + the size of the Gateway agent pool. Due to Azure public IPPrefix size limitation, the valid + value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 + nodes/IPs). The default value is 31.""" + + @overload + def __init__( + self, + *, + public_ip_prefix_size: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolNetworkProfile(_Model): + """Network settings of an agent pool. + + :ivar node_public_ip_tags: IPTags of instance-level public IPs. + :vartype node_public_ip_tags: list[~azure.mgmt.containerservice.models.IPTag] + :ivar allowed_host_ports: The port ranges that are allowed to access. The specified ranges are + allowed to overlap. + :vartype allowed_host_ports: list[~azure.mgmt.containerservice.models.PortRange] + :ivar application_security_groups: The IDs of the application security groups which agent pool + will associate when created. + :vartype application_security_groups: list[str] + """ + + node_public_ip_tags: Optional[list["_models.IPTag"]] = rest_field( + name="nodePublicIPTags", visibility=["read", "create", "update", "delete", "query"] + ) + """IPTags of instance-level public IPs.""" + allowed_host_ports: Optional[list["_models.PortRange"]] = rest_field( + name="allowedHostPorts", visibility=["read", "create", "update", "delete", "query"] + ) + """The port ranges that are allowed to access. The specified ranges are allowed to overlap.""" + application_security_groups: Optional[list[str]] = rest_field( + name="applicationSecurityGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """The IDs of the application security groups which agent pool will associate when created.""" + + @overload + def __init__( + self, + *, + node_public_ip_tags: Optional[list["_models.IPTag"]] = None, + allowed_host_ports: Optional[list["_models.PortRange"]] = None, + application_security_groups: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolRecentlyUsedVersion(_Model): + """A historical version that can be used for rollback operations. + + :ivar orchestrator_version: The Kubernetes version (major.minor.patch) available for rollback. + :vartype orchestrator_version: str + :ivar node_image_version: The node image version available for rollback. + :vartype node_image_version: str + :ivar timestamp: The timestamp when this version was last used. + :vartype timestamp: ~datetime.datetime + """ + + orchestrator_version: Optional[str] = rest_field( + name="orchestratorVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The Kubernetes version (major.minor.patch) available for rollback.""" + node_image_version: Optional[str] = rest_field( + name="nodeImageVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The node image version available for rollback.""" + timestamp: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp when this version was last used.""" + + @overload + def __init__( + self, + *, + orchestrator_version: Optional[str] = None, + node_image_version: Optional[str] = None, + timestamp: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolSecurityProfile(_Model): + """The security settings of an agent pool. + + :ivar enable_vtpm: vTPM is a Trusted Launch feature for configuring a dedicated secure vault + for keys and measurements held locally on the node. For more details, see + aka.ms/aks/trustedlaunch. If not specified, the default is false. + :vartype enable_vtpm: bool + :ivar enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only + signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. + If not specified, the default is false. + :vartype enable_secure_boot: bool + :ivar ssh_access: SSH access method of an agent pool. Known values are: "LocalUser", + "Disabled", and "EntraId". + :vartype ssh_access: str or ~azure.mgmt.containerservice.models.AgentPoolSSHAccess + """ + + enable_vtpm: Optional[bool] = rest_field( + name="enableVTPM", visibility=["read", "create", "update", "delete", "query"] + ) + """vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and + measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not + specified, the default is false.""" + enable_secure_boot: Optional[bool] = rest_field( + name="enableSecureBoot", visibility=["read", "create", "update", "delete", "query"] + ) + """Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and + drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the + default is false.""" + ssh_access: Optional[Union[str, "_models.AgentPoolSSHAccess"]] = rest_field( + name="sshAccess", visibility=["read", "create", "update", "delete", "query"] + ) + """SSH access method of an agent pool. Known values are: \"LocalUser\", \"Disabled\", and + \"EntraId\".""" + + @overload + def __init__( + self, + *, + enable_vtpm: Optional[bool] = None, + enable_secure_boot: Optional[bool] = None, + ssh_access: Optional[Union[str, "_models.AgentPoolSSHAccess"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolStatus(_Model): + """Contains read-only information about the Agent Pool. + + :ivar provisioning_error: The error detail information of the agent pool. Preserves the + detailed info of failure. If there was no error, this field is omitted. + :vartype provisioning_error: ~azure.mgmt.containerservice.models.ErrorDetail + """ + + provisioning_error: Optional["_models.ErrorDetail"] = rest_field(name="provisioningError", visibility=["read"]) + """The error detail information of the agent pool. Preserves the detailed info of failure. If + there was no error, this field is omitted.""" + + +class AgentPoolUpgradeProfile(ProxyResource): + """The list of available upgrades for an agent pool. + + :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.models.SystemData + :ivar properties: The properties of the agent pool upgrade profile. Required. + :vartype properties: ~azure.mgmt.containerservice.models.AgentPoolUpgradeProfileProperties + """ + + properties: "_models.AgentPoolUpgradeProfileProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The properties of the agent pool upgrade profile. Required.""" + + __flattened_items = [ + "kubernetes_version", + "os_type", + "upgrades", + "components_by_releases", + "recently_used_versions", + "latest_node_image_version", + ] + + @overload + def __init__( + self, + *, + properties: "_models.AgentPoolUpgradeProfileProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class AgentPoolUpgradeProfileProperties(_Model): + """The list of available upgrade versions. + + :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. Required. Known values are: + "Linux" and "Windows". + :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] + :ivar components_by_releases: List of components grouped by kubernetes major.minor version. + :vartype components_by_releases: list[~azure.mgmt.containerservice.models.ComponentsByRelease] + :ivar recently_used_versions: List of historical good versions for rollback operations. + :vartype recently_used_versions: + list[~azure.mgmt.containerservice.models.AgentPoolRecentlyUsedVersion] + :ivar latest_node_image_version: The latest AKS supported node image version. + :vartype latest_node_image_version: str + """ + + kubernetes_version: str = rest_field( + name="kubernetesVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The Kubernetes version (major.minor.patch). Required.""" + os_type: Union[str, "_models.OSType"] = rest_field( + name="osType", visibility=["read", "create", "update", "delete", "query"] + ) + """The operating system type. The default is Linux. Required. Known values are: \"Linux\" and + \"Windows\".""" + upgrades: Optional[list["_models.AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of orchestrator types and versions available for upgrade.""" + components_by_releases: Optional[list["_models.ComponentsByRelease"]] = rest_field( + name="componentsByReleases", visibility=["read", "create", "update", "delete", "query"] + ) + """List of components grouped by kubernetes major.minor version.""" + recently_used_versions: Optional[list["_models.AgentPoolRecentlyUsedVersion"]] = rest_field( + name="recentlyUsedVersions", visibility=["read"] + ) + """List of historical good versions for rollback operations.""" + latest_node_image_version: Optional[str] = rest_field( + name="latestNodeImageVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The latest AKS supported node image version.""" + + @overload + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "_models.OSType"], + upgrades: Optional[list["_models.AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, + components_by_releases: Optional[list["_models.ComponentsByRelease"]] = None, + latest_node_image_version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolUpgradeProfilePropertiesUpgradesItem(_Model): # pylint: disable=name-too-long + """Available upgrades for an AgentPool. + + :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 + :ivar is_out_of_support: Whether the Kubernetes version is out of support. + :vartype is_out_of_support: bool + """ + + kubernetes_version: Optional[str] = rest_field( + name="kubernetesVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The Kubernetes version (major.minor.patch).""" + is_preview: Optional[bool] = rest_field( + name="isPreview", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the Kubernetes version is currently in preview.""" + is_out_of_support: Optional[bool] = rest_field( + name="isOutOfSupport", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the Kubernetes version is out of support.""" + + @overload + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + is_out_of_support: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolUpgradeSettings(_Model): + """Settings for upgrading an agentpool. + + :ivar max_surge: The maximum number or percentage of nodes that are surged during upgrade. 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 10%. For more + information, including best practices, see: + `https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster + `_. + :vartype max_surge: str + :ivar max_unavailable: The maximum number or percentage of nodes that can be simultaneously + unavailable during upgrade. This can either be set to an integer (e.g. '1') or a percentage + (e.g. '5%'). If a percentage is specified, it is the percentage of the total agent pool size at + the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, + the default is 0. For more information, including best practices, see: + `https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster + `_. + :vartype max_unavailable: str + :ivar max_blocked_nodes: The maximum number or percentage of extra nodes that are allowed to be + blocked in the agent pool during an upgrade when undrainable node behavior is Cordon. 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 maxSurge. This + must always be greater than or equal to maxSurge. For more information, including best + practices, see: `https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster + `_. + :vartype max_blocked_nodes: str + :ivar drain_timeout_in_minutes: The drain timeout for a node. The amount of time (in minutes) + to wait on eviction of pods and graceful termination per node. This eviction wait time honors + waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not + specified, the default is 30 minutes. + :vartype drain_timeout_in_minutes: int + :ivar node_soak_duration_in_minutes: The soak duration for a node. The amount of time (in + minutes) to wait after draining a node and before reimaging it and moving on to next node. If + not specified, the default is 0 minutes. + :vartype node_soak_duration_in_minutes: int + :ivar undrainable_node_behavior: Defines the behavior for undrainable nodes during upgrade. The + most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such + as pod termination grace period is exceeding the remaining per-node drain timeout or pod is + still being in a running state, can also cause undrainable nodes. Known values are: "Cordon" + and "Schedule". + :vartype undrainable_node_behavior: str or + ~azure.mgmt.containerservice.models.UndrainableNodeBehavior + """ + + max_surge: Optional[str] = rest_field(name="maxSurge", visibility=["read", "create", "update", "delete", "query"]) + """The maximum number or percentage of nodes that are surged during upgrade. 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 10%. For more information, + including best practices, see: `https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster + `_.""" + max_unavailable: Optional[str] = rest_field( + name="maxUnavailable", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number or percentage of nodes that can be simultaneously unavailable during + upgrade. This can either be set to an integer (e.g. '1') or a percentage (e.g. '5%'). If a + percentage is specified, it is the percentage of the total agent pool size at the time of the + upgrade. For percentages, fractional nodes are rounded up. If not specified, the default is 0. + For more information, including best practices, see: + `https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster + `_.""" + max_blocked_nodes: Optional[str] = rest_field( + name="maxBlockedNodes", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number or percentage of extra nodes that are allowed to be blocked in the agent + pool during an upgrade when undrainable node behavior is Cordon. 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 maxSurge. This must always be greater + than or equal to maxSurge. For more information, including best practices, see: + `https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster + `_.""" + drain_timeout_in_minutes: Optional[int] = rest_field( + name="drainTimeoutInMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """The drain timeout for a node. The amount of time (in minutes) to wait on eviction of pods and + graceful termination per node. This eviction wait time honors waiting on pod disruption + budgets. If this time is exceeded, the upgrade fails. If not specified, the default is 30 + minutes.""" + node_soak_duration_in_minutes: Optional[int] = rest_field( + name="nodeSoakDurationInMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """The soak duration for a node. The amount of time (in minutes) to wait after draining a node and + before reimaging it and moving on to next node. If not specified, the default is 0 minutes.""" + undrainable_node_behavior: Optional[Union[str, "_models.UndrainableNodeBehavior"]] = rest_field( + name="undrainableNodeBehavior", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines the behavior for undrainable nodes during upgrade. The most common cause of undrainable + nodes is Pod Disruption Budgets (PDBs), but other issues, such as pod termination grace period + is exceeding the remaining per-node drain timeout or pod is still being in a running state, can + also cause undrainable nodes. Known values are: \"Cordon\" and \"Schedule\".""" + + @overload + def __init__( + self, + *, + max_surge: Optional[str] = None, + max_unavailable: Optional[str] = None, + max_blocked_nodes: Optional[str] = None, + drain_timeout_in_minutes: Optional[int] = None, + node_soak_duration_in_minutes: Optional[int] = None, + undrainable_node_behavior: Optional[Union[str, "_models.UndrainableNodeBehavior"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AgentPoolWindowsProfile(_Model): + """The Windows agent pool's specific profile. + + :ivar disable_outbound_nat: Whether to disable OutboundNAT in windows nodes. 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 + """ + + disable_outbound_nat: Optional[bool] = rest_field( + name="disableOutboundNat", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to disable OutboundNAT in windows nodes. 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.""" + + @overload + def __init__( + self, + *, + disable_outbound_nat: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutoScaleProfile(_Model): + """Specifications on auto-scaling. + + :ivar size: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', + 'Standard_E16s_v3' or 'Standard_D16s_v5'. + :vartype size: str + :ivar min_count: The minimum number of nodes of the specified sizes. + :vartype min_count: int + :ivar max_count: The maximum number of nodes of the specified sizes. + :vartype max_count: int + """ + + size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', 'Standard_E16s_v3' + or 'Standard_D16s_v5'.""" + min_count: Optional[int] = rest_field(name="minCount", visibility=["read", "create", "update", "delete", "query"]) + """The minimum number of nodes of the specified sizes.""" + max_count: Optional[int] = rest_field(name="maxCount", visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of nodes of the specified sizes.""" + + @overload + def __init__( + self, + *, + size: Optional[str] = None, + min_count: Optional[int] = None, + max_count: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AzureKeyVaultKms(_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 the key vault. 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.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 + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable Azure Key Vault key management service. The default is false.""" + key_id: Optional[str] = rest_field(name="keyId", visibility=["read", "create", "update", "delete", "query"]) + """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.""" + key_vault_network_access: Optional[Union[str, "_models.KeyVaultNetworkAccessTypes"]] = rest_field( + name="keyVaultNetworkAccess", visibility=["read", "create", "update", "delete", "query"] + ) + """Network access of the key vault. 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\".""" + key_vault_resource_id: Optional[str] = rest_field( + name="keyVaultResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + key_id: Optional[str] = None, + key_vault_network_access: Optional[Union[str, "_models.KeyVaultNetworkAccessTypes"]] = None, + key_vault_resource_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ClusterUpgradeSettings(_Model): + """Settings for upgrading a cluster. + + :ivar override_settings: Settings for overrides. + :vartype override_settings: ~azure.mgmt.containerservice.models.UpgradeOverrideSettings + """ + + override_settings: Optional["_models.UpgradeOverrideSettings"] = rest_field( + name="overrideSettings", visibility=["read", "create", "update", "delete", "query"] + ) + """Settings for overrides.""" + + @overload + def __init__( + self, + *, + override_settings: Optional["_models.UpgradeOverrideSettings"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CommandResultProperties(_Model): + """The results of a run command. + + :ivar provisioning_state: provisioning State. + :vartype provisioning_state: str + :ivar exit_code: The exit code of the command. + :vartype exit_code: int + :ivar started_at: The time when the command started. + :vartype started_at: ~datetime.datetime + :ivar finished_at: The time when the command finished. + :vartype finished_at: ~datetime.datetime + :ivar logs: The command output. + :vartype logs: str + :ivar reason: An explanation of why provisioningState is set to failed (if so). + :vartype reason: str + """ + + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """provisioning State.""" + exit_code: Optional[int] = rest_field(name="exitCode", visibility=["read"]) + """The exit code of the command.""" + started_at: Optional[datetime.datetime] = rest_field(name="startedAt", visibility=["read"], format="rfc3339") + """The time when the command started.""" + finished_at: Optional[datetime.datetime] = rest_field(name="finishedAt", visibility=["read"], format="rfc3339") + """The time when the command finished.""" + logs: Optional[str] = rest_field(visibility=["read"]) + """The command output.""" + reason: Optional[str] = rest_field(visibility=["read"]) + """An explanation of why provisioningState is set to failed (if so).""" + + +class CompatibleVersions(_Model): + """Version information about a product/service that is compatible with a service mesh revision. + + :ivar name: The product/service name. + :vartype name: str + :ivar versions: Product/service versions compatible with a service mesh add-on revision. + :vartype versions: list[str] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The product/service name.""" + versions: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Product/service versions compatible with a service mesh add-on revision.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + versions: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Component(_Model): + """Component information for a Kubernetes version. + + :ivar name: Component name. + :vartype name: str + :ivar version: Component version. + :vartype version: str + :ivar has_breaking_changes: If upgraded component version contains breaking changes from the + current version. To see a detailed description of what the breaking changes are, visit + `https://learn.microsoft.com/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version + `_. + :vartype has_breaking_changes: bool + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Component name.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Component version.""" + has_breaking_changes: Optional[bool] = rest_field( + name="hasBreakingChanges", visibility=["read", "create", "update", "delete", "query"] + ) + """If upgraded component version contains breaking changes from the current version. To see a + detailed description of what the breaking changes are, visit + `https://learn.microsoft.com/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version + `_.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + version: Optional[str] = None, + has_breaking_changes: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ComponentsByRelease(_Model): + """components of given Kubernetes version. + + :ivar kubernetes_version: The Kubernetes version (major.minor). + :vartype kubernetes_version: str + :ivar components: components of current or upgraded Kubernetes version in the cluster. + :vartype components: list[~azure.mgmt.containerservice.models.Component] + """ + + kubernetes_version: Optional[str] = rest_field( + name="kubernetesVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The Kubernetes version (major.minor).""" + components: Optional[list["_models.Component"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """components of current or upgraded Kubernetes version in the cluster.""" + + @overload + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + components: Optional[list["_models.Component"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ContainerServiceLinuxProfile(_Model): + """Profile for Linux VMs in the container service cluster. + + :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.models.ContainerServiceSshConfiguration + """ + + admin_username: str = rest_field(name="adminUsername", visibility=["read", "create", "update", "delete", "query"]) + """The administrator username to use for Linux VMs. Required.""" + ssh: "_models.ContainerServiceSshConfiguration" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The SSH configuration for Linux-based VMs running on Azure. Required.""" + + @overload + def __init__( + self, + *, + admin_username: str, + ssh: "_models.ContainerServiceSshConfiguration", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ContainerServiceNetworkProfile(_Model): + """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.models.NetworkPlugin + :ivar network_plugin_mode: The mode the network plugin should use. "overlay" + :vartype network_plugin_mode: str or ~azure.mgmt.containerservice.models.NetworkPluginMode + :ivar network_policy: Network policy used for building the Kubernetes network. Known values + are: "none", "calico", "azure", and "cilium". + :vartype network_policy: str or ~azure.mgmt.containerservice.models.NetworkPolicy + :ivar network_mode: The network mode Azure CNI is configured with. 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.models.NetworkMode + :ivar network_dataplane: Network dataplane used in the Kubernetes cluster. Known values are: + "azure" and "cilium". + :vartype network_dataplane: str or ~azure.mgmt.containerservice.models.NetworkDataplane + :ivar advanced_networking: Advanced Networking profile for enabling observability and security + feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. + :vartype advanced_networking: ~azure.mgmt.containerservice.models.AdvancedNetworking + :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. + :vartype pod_cidr: str + :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must + not overlap with any Subnet IP ranges. + :vartype service_cidr: str + :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within + the Kubernetes service address range specified in serviceCidr. + :vartype dns_service_ip: str + :ivar outbound_type: The outbound (egress) routing method. This can only be set at cluster + creation time and cannot be changed later. For more information see `egress outbound type + `_. Known values are: "loadBalancer", + "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway", and "none". + :vartype outbound_type: str or ~azure.mgmt.containerservice.models.OutboundType + :ivar load_balancer_sku: The load balancer sku for the managed cluster. 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.models.LoadBalancerSku + :ivar load_balancer_profile: Profile of the cluster load balancer. + :vartype load_balancer_profile: + ~azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfile + :ivar nat_gateway_profile: Profile of the cluster NAT gateway. + :vartype nat_gateway_profile: + ~azure.mgmt.containerservice.models.ManagedClusterNATGatewayProfile + :ivar static_egress_gateway_profile: The profile for Static Egress Gateway addon. For more + details about Static Egress Gateway, see `https://aka.ms/aks/static-egress-gateway + `_. + :vartype static_egress_gateway_profile: + ~azure.mgmt.containerservice.models.ManagedClusterStaticEgressGatewayProfile + :ivar pod_cidrs: The CIDR notation IP ranges from which to assign pod IPs. 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: The CIDR notation IP ranges from which to assign service cluster IPs. 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: The IP families used to specify IP versions available to the cluster. 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.models.IPFamily] + :ivar pod_link_local_access: Defines access to special link local addresses (Azure Instance + Metadata Service, aka IMDS) for pods with hostNetwork=false. if not specified, the default is + 'IMDS'. Known values are: "IMDS" and "None". + :vartype pod_link_local_access: str or ~azure.mgmt.containerservice.models.PodLinkLocalAccess + :ivar kube_proxy_config: Holds configuration customizations for kube-proxy. Any values not + defined will use the kube-proxy defaulting behavior. See `https://v + `_.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ + where is represented by a - string. Kubernetes version + 1.23 would be '1-23'. + :vartype kube_proxy_config: + ~azure.mgmt.containerservice.models.ContainerServiceNetworkProfileKubeProxyConfig + """ + + network_plugin: Optional[Union[str, "_models.NetworkPlugin"]] = rest_field( + name="networkPlugin", visibility=["read", "create", "update", "delete", "query"] + ) + """Network plugin used for building the Kubernetes network. Known values are: \"azure\", + \"kubenet\", and \"none\".""" + network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = rest_field( + name="networkPluginMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The mode the network plugin should use. \"overlay\"""" + network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = rest_field( + name="networkPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Network policy used for building the Kubernetes network. Known values are: \"none\", + \"calico\", \"azure\", and \"cilium\".""" + network_mode: Optional[Union[str, "_models.NetworkMode"]] = rest_field( + name="networkMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The network mode Azure CNI is configured with. This cannot be specified if networkPlugin is + anything other than 'azure'. Known values are: \"transparent\" and \"bridge\".""" + network_dataplane: Optional[Union[str, "_models.NetworkDataplane"]] = rest_field( + name="networkDataplane", visibility=["read", "create", "update", "delete", "query"] + ) + """Network dataplane used in the Kubernetes cluster. Known values are: \"azure\" and \"cilium\".""" + advanced_networking: Optional["_models.AdvancedNetworking"] = rest_field( + name="advancedNetworking", visibility=["read", "create", "update", "delete", "query"] + ) + """Advanced Networking profile for enabling observability and security feature suite on a cluster. + For more information see aka.ms/aksadvancednetworking.""" + pod_cidr: Optional[str] = rest_field(name="podCidr", visibility=["read", "create", "update", "delete", "query"]) + """A CIDR notation IP range from which to assign pod IPs when kubenet is used.""" + service_cidr: Optional[str] = rest_field( + name="serviceCidr", visibility=["read", "create", "update", "delete", "query"] + ) + """A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any + Subnet IP ranges.""" + dns_service_ip: Optional[str] = rest_field( + name="dnsServiceIP", visibility=["read", "create", "update", "delete", "query"] + ) + """An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service + address range specified in serviceCidr.""" + outbound_type: Optional[Union[str, "_models.OutboundType"]] = rest_field( + name="outboundType", visibility=["read", "create", "update", "delete", "query"] + ) + """The outbound (egress) routing method. This can only be set at cluster creation time and cannot + be changed later. For more information see `egress outbound type + `_. Known values are: + \"loadBalancer\", \"userDefinedRouting\", \"managedNATGateway\", \"userAssignedNATGateway\", + and \"none\".""" + load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = rest_field( + name="loadBalancerSku", visibility=["read", "create", "update", "delete", "query"] + ) + """The load balancer sku for the managed cluster. 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\".""" + load_balancer_profile: Optional["_models.ManagedClusterLoadBalancerProfile"] = rest_field( + name="loadBalancerProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Profile of the cluster load balancer.""" + nat_gateway_profile: Optional["_models.ManagedClusterNATGatewayProfile"] = rest_field( + name="natGatewayProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Profile of the cluster NAT gateway.""" + static_egress_gateway_profile: Optional["_models.ManagedClusterStaticEgressGatewayProfile"] = rest_field( + name="staticEgressGatewayProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The profile for Static Egress Gateway addon. For more details about Static Egress Gateway, see + `https://aka.ms/aks/static-egress-gateway `_.""" + pod_cidrs: Optional[list[str]] = rest_field( + name="podCidrs", visibility=["read", "create", "update", "delete", "query"] + ) + """The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for + single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for + dual-stack networking.""" + service_cidrs: Optional[list[str]] = rest_field( + name="serviceCidrs", visibility=["read", "create", "update", "delete", "query"] + ) + """The CIDR notation IP ranges from which to assign service cluster IPs. 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.""" + ip_families: Optional[list[Union[str, "_models.IPFamily"]]] = rest_field( + name="ipFamilies", visibility=["read", "create", "update", "delete", "query"] + ) + """The IP families used to specify IP versions available to the cluster. 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.""" + pod_link_local_access: Optional[Union[str, "_models.PodLinkLocalAccess"]] = rest_field( + name="podLinkLocalAccess", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines access to special link local addresses (Azure Instance Metadata Service, aka IMDS) for + pods with hostNetwork=false. if not specified, the default is 'IMDS'. Known values are: + \"IMDS\" and \"None\".""" + kube_proxy_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfig"] = rest_field( + name="kubeProxyConfig", visibility=["read", "create", "update", "delete", "query"] + ) + """Holds configuration customizations for kube-proxy. Any values not defined will use the + kube-proxy defaulting behavior. See `https://v + `_.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ + where is represented by a - string. Kubernetes version + 1.23 would be '1-23'.""" + + @overload + def __init__( + self, + *, + network_plugin: Optional[Union[str, "_models.NetworkPlugin"]] = None, + network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = None, + network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "_models.NetworkMode"]] = None, + network_dataplane: Optional[Union[str, "_models.NetworkDataplane"]] = None, + advanced_networking: Optional["_models.AdvancedNetworking"] = None, + pod_cidr: Optional[str] = None, + service_cidr: Optional[str] = None, + dns_service_ip: Optional[str] = None, + outbound_type: Optional[Union[str, "_models.OutboundType"]] = None, + load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = None, + load_balancer_profile: Optional["_models.ManagedClusterLoadBalancerProfile"] = None, + nat_gateway_profile: Optional["_models.ManagedClusterNATGatewayProfile"] = None, + static_egress_gateway_profile: Optional["_models.ManagedClusterStaticEgressGatewayProfile"] = None, + pod_cidrs: Optional[list[str]] = None, + service_cidrs: Optional[list[str]] = None, + ip_families: Optional[list[Union[str, "_models.IPFamily"]]] = None, + pod_link_local_access: Optional[Union[str, "_models.PodLinkLocalAccess"]] = None, + kube_proxy_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfig"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ContainerServiceNetworkProfileKubeProxyConfig(_Model): # pylint: disable=name-too-long + """Holds configuration customizations for kube-proxy. Any values not defined will use the + kube-proxy defaulting behavior. See `https://v + `_.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ + where is represented by a - 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', 'IPVS' or 'NFTABLES'). Known values + are: "IPTABLES", "IPVS", and "NFTABLES". + :vartype mode: str or ~azure.mgmt.containerservice.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.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, kube-proxy is + enabled in AKS by default without these customizations).""" + mode: Optional[Union[str, "_models.Mode"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specify which proxy mode to use ('IPTABLES', 'IPVS' or 'NFTABLES'). Known values are: + \"IPTABLES\", \"IPVS\", and \"NFTABLES\".""" + ipvs_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig"] = rest_field( + name="ipvsConfig", visibility=["read", "create", "update", "delete", "query"] + ) + """Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + mode: Optional[Union[str, "_models.Mode"]] = None, + ipvs_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(_Model): # pylint: disable=name-too-long + """Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. + + :ivar scheduler: IPVS scheduler, for more information please see + `http://www.linuxvirtualserver.org/docs/scheduling.html + `_. Known values are: "RoundRobin" and + "LeastConnection". + :vartype scheduler: str or ~azure.mgmt.containerservice.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 + """ + + scheduler: Optional[Union[str, "_models.IpvsScheduler"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """IPVS scheduler, for more information please see + `http://www.linuxvirtualserver.org/docs/scheduling.html + `_. Known values are: \"RoundRobin\" + and \"LeastConnection\".""" + tcp_timeout_seconds: Optional[int] = rest_field( + name="tcpTimeoutSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """The timeout value used for idle IPVS TCP sessions in seconds. Must be a positive integer value.""" + tcp_fin_timeout_seconds: Optional[int] = rest_field( + name="tcpFinTimeoutSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """The timeout value used for IPVS TCP sessions after receiving a FIN in seconds. Must be a + positive integer value.""" + udp_timeout_seconds: Optional[int] = rest_field( + name="udpTimeoutSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """The timeout value used for IPVS UDP packets in seconds. Must be a positive integer value.""" + + @overload + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ContainerServiceSshConfiguration(_Model): + """SSH configuration for Linux-based VMs running on 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.models.ContainerServiceSshPublicKey] + """ + + public_keys: list["_models.ContainerServiceSshPublicKey"] = rest_field( + name="publicKeys", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of SSH public keys used to authenticate with Linux-based VMs. A maximum of 1 key may + be specified. Required.""" + + @overload + def __init__( + self, + *, + public_keys: list["_models.ContainerServiceSshPublicKey"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ContainerServiceSshPublicKey(_Model): + """Contains information about SSH certificate public key data. + + :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 + """ + + key_data: str = rest_field(name="keyData", visibility=["read", "create", "update", "delete", "query"]) + """Certificate public key used to authenticate with VMs through SSH. The certificate must be in + PEM format with or without headers. Required.""" + + @overload + def __init__( + self, + *, + key_data: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CreationData(_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 + """ + + source_resource_id: Optional[str] = rest_field( + name="sourceResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """This is the ARM ID of the source object to be used to create the target object.""" + + @overload + def __init__( + self, + *, + source_resource_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CredentialResult(_Model): + """The credential result response. + + :ivar name: The name of the credential. + :vartype name: str + :ivar value: Base64-encoded Kubernetes configuration file. + :vartype value: bytes + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the credential.""" + value: Optional[bytes] = rest_field(visibility=["read"], format="base64") + """Base64-encoded Kubernetes configuration file.""" + + +class CredentialResults(_Model): + """The list credential result response. + + :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. + :vartype kubeconfigs: list[~azure.mgmt.containerservice.models.CredentialResult] + """ + + kubeconfigs: Optional[list["_models.CredentialResult"]] = rest_field(visibility=["read"]) + """Base64-encoded Kubernetes configuration file.""" + + +class DailySchedule(_Model): + """For schedules like: 'recur every day' or 'recur every 3 days'. + + :ivar interval_days: Specifies the number of days between each set of occurrences. Required. + :vartype interval_days: int + """ + + interval_days: int = rest_field(name="intervalDays", visibility=["read", "create", "update", "delete", "query"]) + """Specifies the number of days between each set of occurrences. Required.""" + + @overload + def __init__( + self, + *, + interval_days: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DateSpan(_Model): + """A date range. For example, between '2022-12-23' and '2023-01-05'. + + :ivar start: The start date of the date span. Required. + :vartype start: ~datetime.date + :ivar end: The end date of the date span. Required. + :vartype end: ~datetime.date + """ + + start: datetime.date = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The start date of the date span. Required.""" + end: datetime.date = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The end date of the date span. Required.""" + + @overload + def __init__( + self, + *, + start: datetime.date, + end: datetime.date, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DelegatedResource(_Model): + """Delegated resource properties - internal use only. + + :ivar resource_id: The ARM resource id of the delegated resource - internal use only. + :vartype resource_id: str + :ivar tenant_id: The tenant id of the delegated resource - internal use only. + :vartype tenant_id: str + :ivar referral_resource: The delegation id of the referral delegation (optional) - internal use + only. + :vartype referral_resource: str + :ivar location: The source resource location - internal use only. + :vartype location: str + """ + + resource_id: Optional[str] = rest_field( + name="resourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The ARM resource id of the delegated resource - internal use only.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """The tenant id of the delegated resource - internal use only.""" + referral_resource: Optional[str] = rest_field( + name="referralResource", visibility=["read", "create", "update", "delete", "query"] + ) + """The delegation id of the referral delegation (optional) - internal use only.""" + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The source resource location - internal use only.""" + + @overload + def __init__( + self, + *, + resource_id: Optional[str] = None, + tenant_id: Optional[str] = None, + referral_resource: Optional[str] = None, + location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EndpointDependency(_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.models.EndpointDetail] + """ + + domain_name: Optional[str] = rest_field( + name="domainName", visibility=["read", "create", "update", "delete", "query"] + ) + """The domain name of the dependency.""" + endpoint_details: Optional[list["_models.EndpointDetail"]] = rest_field( + name="endpointDetails", visibility=["read", "create", "update", "delete", "query"] + ) + """The Ports and Protocols used when connecting to domainName.""" + + @overload + def __init__( + self, + *, + domain_name: Optional[str] = None, + endpoint_details: Optional[list["_models.EndpointDetail"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EndpointDetail(_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 + """ + + ip_address: Optional[str] = rest_field(name="ipAddress", visibility=["read", "create", "update", "delete", "query"]) + """An IP Address that Domain Name currently resolves to.""" + port: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The port an endpoint is connected to.""" + protocol: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The protocol used for connection.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Description of the detail.""" + + @overload + def __init__( + self, + *, + ip_address: Optional[str] = None, + port: Optional[int] = None, + protocol: Optional[str] = None, + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.containerservice.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.containerservice.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.containerservice.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExtendedLocation(_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.models.ExtendedLocationTypes + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the extended location.""" + type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the extended location. \"EdgeZone\"""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GPUProfile(_Model): + """GPU settings for the Agent Pool. + + :ivar driver: Whether to install GPU drivers. When it's not specified, default is Install. + Known values are: "Install" and "None". + :vartype driver: str or ~azure.mgmt.containerservice.models.GPUDriver + :ivar driver_type: Specify the type of GPU driver to install when creating Windows agent pools. + If not provided, AKS selects the driver based on system compatibility. This cannot be changed + once the AgentPool has been created. This cannot be set on Linux AgentPools. For Linux + AgentPools, the driver is selected based on system compatibility. Known values are: "GRID" and + "CUDA". + :vartype driver_type: str or ~azure.mgmt.containerservice.models.DriverType + """ + + driver: Optional[Union[str, "_models.GPUDriver"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to install GPU drivers. When it's not specified, default is Install. Known values are: + \"Install\" and \"None\".""" + driver_type: Optional[Union[str, "_models.DriverType"]] = rest_field( + name="driverType", visibility=["read", "create", "update", "delete", "query"] + ) + """Specify the type of GPU driver to install when creating Windows agent pools. If not provided, + AKS selects the driver based on system compatibility. This cannot be changed once the AgentPool + has been created. This cannot be set on Linux AgentPools. For Linux AgentPools, the driver is + selected based on system compatibility. Known values are: \"GRID\" and \"CUDA\".""" + + @overload + def __init__( + self, + *, + driver: Optional[Union[str, "_models.GPUDriver"]] = None, + driver_type: Optional[Union[str, "_models.DriverType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GuardrailsAvailableVersion(ProxyResource): + """Available Guardrails Version. + + :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.models.SystemData + :ivar properties: Whether the version is default or not and support info. Required. + :vartype properties: ~azure.mgmt.containerservice.models.GuardrailsAvailableVersionsProperties + """ + + properties: "_models.GuardrailsAvailableVersionsProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the version is default or not and support info. Required.""" + + @overload + def __init__( + self, + *, + properties: "_models.GuardrailsAvailableVersionsProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class GuardrailsAvailableVersionsProperties(_Model): + """Whether the version is default or not and support info. + + :ivar is_default_version: Whether this is the default version. + :vartype is_default_version: bool + :ivar support: Whether the version is preview or stable. Known values are: "Preview" and + "Stable". + :vartype support: str or ~azure.mgmt.containerservice.models.GuardrailsSupport + """ + + is_default_version: Optional[bool] = rest_field(name="isDefaultVersion", visibility=["read"]) + """Whether this is the default version.""" + support: Optional[Union[str, "_models.GuardrailsSupport"]] = rest_field(visibility=["read"]) + """Whether the version is preview or stable. Known values are: \"Preview\" and \"Stable\".""" + + +class IdentityBinding(ProxyResource): + """The IdentityBinding resource. + + :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.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.containerservice.models.IdentityBindingProperties + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str + """ + + properties: Optional["_models.IdentityBindingProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.IdentityBindingProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IdentityBindingManagedIdentityProfile(_Model): + """Managed identity profile for the identity binding. + + :ivar resource_id: The resource ID of the managed identity. Required. + :vartype resource_id: str + :ivar object_id: The object ID of the managed identity. + :vartype object_id: str + :ivar client_id: The client ID of the managed identity. + :vartype client_id: str + :ivar tenant_id: The tenant ID of the managed identity. + :vartype tenant_id: str + """ + + resource_id: str = rest_field(name="resourceId", visibility=["read", "create"]) + """The resource ID of the managed identity. Required.""" + object_id: Optional[str] = rest_field(name="objectId", visibility=["read"]) + """The object ID of the managed identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the managed identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the managed identity.""" + + @overload + def __init__( + self, + *, + resource_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IdentityBindingOidcIssuerProfile(_Model): + """IdentityBinding OIDC issuer profile. + + :ivar oidc_issuer_url: The OIDC issuer URL of the IdentityBinding. + :vartype oidc_issuer_url: str + """ + + oidc_issuer_url: Optional[str] = rest_field(name="oidcIssuerUrl", visibility=["read"]) + """The OIDC issuer URL of the IdentityBinding.""" + + +class IdentityBindingProperties(_Model): + """IdentityBinding properties. + + :ivar managed_identity: Managed identity profile for the identity binding. Required. + :vartype managed_identity: + ~azure.mgmt.containerservice.models.IdentityBindingManagedIdentityProfile + :ivar oidc_issuer: The OIDC issuer URL of the IdentityBinding. + :vartype oidc_issuer: ~azure.mgmt.containerservice.models.IdentityBindingOidcIssuerProfile + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.models.IdentityBindingProvisioningState + """ + + managed_identity: "_models.IdentityBindingManagedIdentityProfile" = rest_field( + name="managedIdentity", visibility=["read", "create"] + ) + """Managed identity profile for the identity binding. Required.""" + oidc_issuer: Optional["_models.IdentityBindingOidcIssuerProfile"] = rest_field( + name="oidcIssuer", visibility=["read"] + ) + """The OIDC issuer URL of the IdentityBinding.""" + provisioning_state: Optional[Union[str, "_models.IdentityBindingProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Creating\", \"Updating\", and \"Deleting\".""" + + @overload + def __init__( + self, + *, + managed_identity: "_models.IdentityBindingManagedIdentityProfile", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IPTag(_Model): + """Contains the IPTag associated with the object. + + :ivar ip_tag_type: The IP tag type. Example: RoutingPreference. + :vartype ip_tag_type: str + :ivar tag: The value of the IP tag associated with the public IP. Example: Internet. + :vartype tag: str + """ + + ip_tag_type: Optional[str] = rest_field( + name="ipTagType", visibility=["read", "create", "update", "delete", "query"] + ) + """The IP tag type. Example: RoutingPreference.""" + tag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The value of the IP tag associated with the public IP. Example: Internet.""" + + @overload + def __init__( + self, + *, + ip_tag_type: Optional[str] = None, + tag: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IstioCertificateAuthority(_Model): + """Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin + certificates as described here `https://aka.ms/asm-plugin-ca `_. + + :ivar plugin: Plugin certificates information for Service Mesh. + :vartype plugin: ~azure.mgmt.containerservice.models.IstioPluginCertificateAuthority + """ + + plugin: Optional["_models.IstioPluginCertificateAuthority"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Plugin certificates information for Service Mesh.""" + + @overload + def __init__( + self, + *, + plugin: Optional["_models.IstioPluginCertificateAuthority"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IstioComponents(_Model): + """Istio components configuration. + + :ivar ingress_gateways: Istio ingress gateways. + :vartype ingress_gateways: list[~azure.mgmt.containerservice.models.IstioIngressGateway] + :ivar egress_gateways: Istio egress gateways. + :vartype egress_gateways: list[~azure.mgmt.containerservice.models.IstioEgressGateway] + :ivar proxy_redirection_mechanism: Mode of traffic redirection. Known values are: + "InitContainers" and "CNIChaining". + :vartype proxy_redirection_mechanism: str or + ~azure.mgmt.containerservice.models.ProxyRedirectionMechanism + """ + + ingress_gateways: Optional[list["_models.IstioIngressGateway"]] = rest_field( + name="ingressGateways", visibility=["read", "create", "update", "delete", "query"] + ) + """Istio ingress gateways.""" + egress_gateways: Optional[list["_models.IstioEgressGateway"]] = rest_field( + name="egressGateways", visibility=["read", "create", "update", "delete", "query"] + ) + """Istio egress gateways.""" + proxy_redirection_mechanism: Optional[Union[str, "_models.ProxyRedirectionMechanism"]] = rest_field( + name="proxyRedirectionMechanism", visibility=["read", "create", "update", "delete", "query"] + ) + """Mode of traffic redirection. Known values are: \"InitContainers\" and \"CNIChaining\".""" + + @overload + def __init__( + self, + *, + ingress_gateways: Optional[list["_models.IstioIngressGateway"]] = None, + egress_gateways: Optional[list["_models.IstioEgressGateway"]] = None, + proxy_redirection_mechanism: Optional[Union[str, "_models.ProxyRedirectionMechanism"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IstioEgressGateway(_Model): + """Istio egress gateway configuration. + + :ivar enabled: Whether to enable the egress gateway. Required. + :vartype enabled: bool + :ivar name: Name of the Istio add-on egress gateway. Required. + :vartype name: str + :ivar namespace: Namespace that the Istio add-on egress gateway should be deployed in. If + unspecified, the default is aks-istio-egress. + :vartype namespace: str + :ivar gateway_configuration_name: Name of the gateway configuration custom resource for the + Istio add-on egress gateway. Must be specified when enabling the Istio egress gateway. Must be + deployed in the same namespace that the Istio egress gateway will be deployed in. + :vartype gateway_configuration_name: str + """ + + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable the egress gateway. Required.""" + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the Istio add-on egress gateway. Required.""" + namespace: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Namespace that the Istio add-on egress gateway should be deployed in. If unspecified, the + default is aks-istio-egress.""" + gateway_configuration_name: Optional[str] = rest_field( + name="gatewayConfigurationName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the gateway configuration custom resource for the Istio add-on egress gateway. Must be + specified when enabling the Istio egress gateway. Must be deployed in the same namespace that + the Istio egress gateway will be deployed in.""" + + @overload + def __init__( + self, + *, + enabled: bool, + name: str, + namespace: Optional[str] = None, + gateway_configuration_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IstioIngressGateway(_Model): + """Istio ingress gateway configuration. For now, we support up to one external ingress gateway + named ``aks-istio-ingressgateway-external`` and one internal ingress gateway named + ``aks-istio-ingressgateway-internal``. + + :ivar mode: Mode of an ingress gateway. Required. Known values are: "External" and "Internal". + :vartype mode: str or ~azure.mgmt.containerservice.models.IstioIngressGatewayMode + :ivar enabled: Whether to enable the ingress gateway. Required. + :vartype enabled: bool + """ + + mode: Union[str, "_models.IstioIngressGatewayMode"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Mode of an ingress gateway. Required. Known values are: \"External\" and \"Internal\".""" + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable the ingress gateway. Required.""" + + @overload + def __init__( + self, + *, + mode: Union[str, "_models.IstioIngressGatewayMode"], + enabled: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IstioPluginCertificateAuthority(_Model): + """Plugin certificates information for Service Mesh. + + :ivar key_vault_id: The resource ID of the Key Vault. + :vartype key_vault_id: str + :ivar cert_object_name: Intermediate certificate object name in Azure Key Vault. + :vartype cert_object_name: str + :ivar key_object_name: Intermediate certificate private key object name in Azure Key Vault. + :vartype key_object_name: str + :ivar root_cert_object_name: Root certificate object name in Azure Key Vault. + :vartype root_cert_object_name: str + :ivar cert_chain_object_name: Certificate chain object name in Azure Key Vault. + :vartype cert_chain_object_name: str + """ + + key_vault_id: Optional[str] = rest_field( + name="keyVaultId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the Key Vault.""" + cert_object_name: Optional[str] = rest_field( + name="certObjectName", visibility=["read", "create", "update", "delete", "query"] + ) + """Intermediate certificate object name in Azure Key Vault.""" + key_object_name: Optional[str] = rest_field( + name="keyObjectName", visibility=["read", "create", "update", "delete", "query"] + ) + """Intermediate certificate private key object name in Azure Key Vault.""" + root_cert_object_name: Optional[str] = rest_field( + name="rootCertObjectName", visibility=["read", "create", "update", "delete", "query"] + ) + """Root certificate object name in Azure Key Vault.""" + cert_chain_object_name: Optional[str] = rest_field( + name="certChainObjectName", visibility=["read", "create", "update", "delete", "query"] + ) + """Certificate chain object name in Azure Key Vault.""" + + @overload + def __init__( + self, + *, + key_vault_id: Optional[str] = None, + cert_object_name: Optional[str] = None, + key_object_name: Optional[str] = None, + root_cert_object_name: Optional[str] = None, + cert_chain_object_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IstioServiceMesh(_Model): + """Istio service mesh configuration. + + :ivar components: Istio components configuration. + :vartype components: ~azure.mgmt.containerservice.models.IstioComponents + :ivar certificate_authority: Istio Service Mesh Certificate Authority (CA) configuration. For + now, we only support plugin certificates as described here `https://aka.ms/asm-plugin-ca + `_. + :vartype certificate_authority: ~azure.mgmt.containerservice.models.IstioCertificateAuthority + :ivar revisions: The list of revisions of the Istio control plane. When an upgrade is not in + progress, this holds one value. When canary upgrade is in progress, this can only hold two + consecutive values. For more information, see: + `https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + `_. + :vartype revisions: list[str] + """ + + components: Optional["_models.IstioComponents"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Istio components configuration.""" + certificate_authority: Optional["_models.IstioCertificateAuthority"] = rest_field( + name="certificateAuthority", visibility=["read", "create", "update", "delete", "query"] + ) + """Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin + certificates as described here `https://aka.ms/asm-plugin-ca `_.""" + revisions: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The list of revisions of the Istio control plane. When an upgrade is not in progress, this + holds one value. When canary upgrade is in progress, this can only hold two consecutive values. + For more information, see: `https://learn.microsoft.com/en-us/azure/aks/istio-upgrade + `_.""" + + @overload + def __init__( + self, + *, + components: Optional["_models.IstioComponents"] = None, + certificate_authority: Optional["_models.IstioCertificateAuthority"] = None, + revisions: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JWTAuthenticator(ProxyResource): + """Configuration for JWT authenticator in the managed cluster. + + :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.models.SystemData + :ivar properties: The properties of JWTAuthenticator. For details on how to configure the + properties of a JWT authenticator, please refer to the Kubernetes documentation: + `https://kubernetes.io/docs/reference/access-authn-authz/authentication/#using-authentication-configuration + `_. + Please note that not all fields available in the Kubernetes documentation are supported by AKS. + For troubleshooting, please see `https://aka.ms/aks-external-issuers-docs + `_. Required. + :vartype properties: ~azure.mgmt.containerservice.models.JWTAuthenticatorProperties + """ + + properties: "_models.JWTAuthenticatorProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The properties of JWTAuthenticator. For details on how to configure the properties of a JWT + authenticator, please refer to the Kubernetes documentation: + `https://kubernetes.io/docs/reference/access-authn-authz/authentication/#using-authentication-configuration + `_. + Please note that not all fields available in the Kubernetes documentation are supported by AKS. + For troubleshooting, please see `https://aka.ms/aks-external-issuers-docs + `_. Required.""" + + @overload + def __init__( + self, + *, + properties: "_models.JWTAuthenticatorProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JWTAuthenticatorClaimMappingExpression(_Model): + """The claim mapping expression for JWTAuthenticator. + + :ivar expression: The CEL expression used to access token claims. Required. + :vartype expression: str + """ + + expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The CEL expression used to access token claims. Required.""" + + @overload + def __init__( + self, + *, + expression: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JWTAuthenticatorClaimMappings(_Model): + """The claim mappings for JWTAuthenticator. + + :ivar username: The expression to extract username attribute from the token claims. Required. + :vartype username: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression + :ivar groups: The expression to extract groups attribute from the token claims. When not + provided, no groups are extracted from the token claims. + :vartype groups: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression + :ivar uid: The expression to extract uid attribute from the token claims. When not provided, no + uid is extracted from the token claims. + :vartype uid: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression + :ivar extra: The expression to extract extra attribute from the token claims. When not + provided, no extra attributes are extracted from the token claims. + :vartype extra: + list[~azure.mgmt.containerservice.models.JWTAuthenticatorExtraClaimMappingExpression] + """ + + username: "_models.JWTAuthenticatorClaimMappingExpression" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The expression to extract username attribute from the token claims. Required.""" + groups: Optional["_models.JWTAuthenticatorClaimMappingExpression"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The expression to extract groups attribute from the token claims. When not provided, no groups + are extracted from the token claims.""" + uid: Optional["_models.JWTAuthenticatorClaimMappingExpression"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The expression to extract uid attribute from the token claims. When not provided, no uid is + extracted from the token claims.""" + extra: Optional[list["_models.JWTAuthenticatorExtraClaimMappingExpression"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The expression to extract extra attribute from the token claims. When not provided, no extra + attributes are extracted from the token claims.""" + + @overload + def __init__( + self, + *, + username: "_models.JWTAuthenticatorClaimMappingExpression", + groups: Optional["_models.JWTAuthenticatorClaimMappingExpression"] = None, + uid: Optional["_models.JWTAuthenticatorClaimMappingExpression"] = None, + extra: Optional[list["_models.JWTAuthenticatorExtraClaimMappingExpression"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JWTAuthenticatorExtraClaimMappingExpression(_Model): # pylint: disable=name-too-long + """The extra claim mapping expression for JWTAuthenticator. + + :ivar key: The key of the extra attribute. Required. + :vartype key: str + :ivar value_expression: The CEL expression used to extract the value of the extra attribute. + Required. + :vartype value_expression: str + """ + + key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The key of the extra attribute. Required.""" + value_expression: str = rest_field( + name="valueExpression", visibility=["read", "create", "update", "delete", "query"] + ) + """The CEL expression used to extract the value of the extra attribute. Required.""" + + @overload + def __init__( + self, + *, + key: str, + value_expression: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JWTAuthenticatorIssuer(_Model): + """The OIDC issuer details for JWTAuthenticator. + + :ivar url: The issuer URL. The URL must begin with the scheme https and cannot contain a query + string or fragment. This must match the "iss" claim in the presented JWT, and the issuer + returned from discovery. Required. + :vartype url: str + :ivar audiences: The set of acceptable audiences the JWT must be issued to. At least one is + required. When multiple is set, AudienceMatchPolicy is used in API Server configuration. + Required. + :vartype audiences: list[str] + """ + + url: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The issuer URL. The URL must begin with the scheme https and cannot contain a query string or + fragment. This must match the \"iss\" claim in the presented JWT, and the issuer returned from + discovery. Required.""" + audiences: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The set of acceptable audiences the JWT must be issued to. At least one is required. When + multiple is set, AudienceMatchPolicy is used in API Server configuration. Required.""" + + @overload + def __init__( + self, + *, + url: str, + audiences: list[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JWTAuthenticatorProperties(_Model): + """The properties of JWTAuthenticator. For details on how to configure the properties of a JWT + authenticator, please refer to the Kubernetes documentation: + `https://kubernetes.io/docs/reference/access-authn-authz/authentication/#using-authentication-configuration + `_. + Please note that not all fields available in the Kubernetes documentation are supported by AKS. + For troubleshooting, please see `https://aka.ms/aks-external-issuers-docs + `_. + + :ivar provisioning_state: The current provisioning state of the JWT authenticator. Known values + are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.models.JWTAuthenticatorProvisioningState + :ivar issuer: The JWT OIDC issuer details. Required. + :vartype issuer: ~azure.mgmt.containerservice.models.JWTAuthenticatorIssuer + :ivar claim_validation_rules: The rules that are applied to validate token claims to + authenticate users. All the expressions must evaluate to true for validation to succeed. + :vartype claim_validation_rules: + list[~azure.mgmt.containerservice.models.JWTAuthenticatorValidationRule] + :ivar claim_mappings: The mappings that define how user attributes are extracted from the token + claims. Required. + :vartype claim_mappings: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappings + :ivar user_validation_rules: The rules that are applied to the mapped user before completing + authentication. All the expressions must evaluate to true for validation to succeed. + :vartype user_validation_rules: + list[~azure.mgmt.containerservice.models.JWTAuthenticatorValidationRule] + """ + + provisioning_state: Optional[Union[str, "_models.JWTAuthenticatorProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The current provisioning state of the JWT authenticator. Known values are: \"Succeeded\", + \"Failed\", \"Canceled\", \"Creating\", \"Updating\", and \"Deleting\".""" + issuer: "_models.JWTAuthenticatorIssuer" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The JWT OIDC issuer details. Required.""" + claim_validation_rules: Optional[list["_models.JWTAuthenticatorValidationRule"]] = rest_field( + name="claimValidationRules", visibility=["read", "create", "update", "delete", "query"] + ) + """The rules that are applied to validate token claims to authenticate users. All the expressions + must evaluate to true for validation to succeed.""" + claim_mappings: "_models.JWTAuthenticatorClaimMappings" = rest_field( + name="claimMappings", visibility=["read", "create", "update", "delete", "query"] + ) + """The mappings that define how user attributes are extracted from the token claims. Required.""" + user_validation_rules: Optional[list["_models.JWTAuthenticatorValidationRule"]] = rest_field( + name="userValidationRules", visibility=["read", "create", "update", "delete", "query"] + ) + """The rules that are applied to the mapped user before completing authentication. All the + expressions must evaluate to true for validation to succeed.""" + + @overload + def __init__( + self, + *, + issuer: "_models.JWTAuthenticatorIssuer", + claim_mappings: "_models.JWTAuthenticatorClaimMappings", + claim_validation_rules: Optional[list["_models.JWTAuthenticatorValidationRule"]] = None, + user_validation_rules: Optional[list["_models.JWTAuthenticatorValidationRule"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JWTAuthenticatorValidationRule(_Model): + """The validation rule for JWTAuthenticator. + + :ivar expression: The CEL expression used to validate the claim or attribute. Required. + :vartype expression: str + :ivar message: The validation error message. + :vartype message: str + """ + + expression: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The CEL expression used to validate the claim or attribute. Required.""" + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The validation error message.""" + + @overload + def __init__( + self, + *, + expression: str, + message: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class KubeletConfig(_Model): + """Kubelet configurations of agent nodes. See `AKS custom node configuration + `_ for more details. + + :ivar cpu_manager_policy: The CPU Manager policy to use. 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: If CPU CFS quota enforcement is enabled for containers that specify CPU + limits. The default is true. + :vartype cpu_cfs_quota: bool + :ivar cpu_cfs_quota_period: The CPU CFS quota period value. 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: The percent of disk usage after which image garbage collection + is always run. To disable image garbage collection, set to 100. The default is 85%. + :vartype image_gc_high_threshold: int + :ivar image_gc_low_threshold: The percent of disk usage before which image garbage collection + is never run. This cannot be set higher than imageGcHighThreshold. The default is 80%. + :vartype image_gc_low_threshold: int + :ivar topology_manager_policy: The Topology Manager policy to use. 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 + :ivar seccomp_default: Specifies the default seccomp profile applied to all workloads. If not + specified, 'Unconfined' will be used by default. Known values are: "Unconfined" and + "RuntimeDefault". + :vartype seccomp_default: str or ~azure.mgmt.containerservice.models.SeccompDefault + """ + + cpu_manager_policy: Optional[str] = rest_field( + name="cpuManagerPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """The CPU Manager policy to use. The default is 'none'. See `Kubernetes CPU management policies + `_ + for more information. Allowed values are 'none' and 'static'.""" + cpu_cfs_quota: Optional[bool] = rest_field( + name="cpuCfsQuota", visibility=["read", "create", "update", "delete", "query"] + ) + """If CPU CFS quota enforcement is enabled for containers that specify CPU limits. The default is + true.""" + cpu_cfs_quota_period: Optional[str] = rest_field( + name="cpuCfsQuotaPeriod", visibility=["read", "create", "update", "delete", "query"] + ) + """The CPU CFS quota period value. 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'.""" + image_gc_high_threshold: Optional[int] = rest_field( + name="imageGcHighThreshold", visibility=["read", "create", "update", "delete", "query"] + ) + """The percent of disk usage after which image garbage collection is always run. To disable image + garbage collection, set to 100. The default is 85%.""" + image_gc_low_threshold: Optional[int] = rest_field( + name="imageGcLowThreshold", visibility=["read", "create", "update", "delete", "query"] + ) + """The percent of disk usage before which image garbage collection is never run. This cannot be + set higher than imageGcHighThreshold. The default is 80%.""" + topology_manager_policy: Optional[str] = rest_field( + name="topologyManagerPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """The Topology Manager policy to use. For more information see `Kubernetes Topology Manager + `_. The default is + 'none'. Allowed values are 'none', 'best-effort', 'restricted', and 'single-numa-node'.""" + allowed_unsafe_sysctls: Optional[list[str]] = rest_field( + name="allowedUnsafeSysctls", visibility=["read", "create", "update", "delete", "query"] + ) + """Allowed list of unsafe sysctls or unsafe sysctl patterns (ending in ``*``).""" + fail_swap_on: Optional[bool] = rest_field( + name="failSwapOn", visibility=["read", "create", "update", "delete", "query"] + ) + """If set to true it will make the Kubelet fail to start if swap is enabled on the node.""" + container_log_max_size_mb: Optional[int] = rest_field( + name="containerLogMaxSizeMB", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum size (e.g. 10Mi) of container log file before it is rotated.""" + container_log_max_files: Optional[int] = rest_field( + name="containerLogMaxFiles", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number of container log files that can be present for a container. The number must + be ≥ 2.""" + pod_max_pids: Optional[int] = rest_field( + name="podMaxPids", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number of processes per pod.""" + seccomp_default: Optional[Union[str, "_models.SeccompDefault"]] = rest_field( + name="seccompDefault", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the default seccomp profile applied to all workloads. If not specified, 'Unconfined' + will be used by default. Known values are: \"Unconfined\" and \"RuntimeDefault\".""" + + @overload + 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, + seccomp_default: Optional[Union[str, "_models.SeccompDefault"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class KubernetesPatchVersion(_Model): + """Kubernetes patch version profile. + + :ivar upgrades: Possible upgrade path for given patch version. + :vartype upgrades: list[str] + """ + + upgrades: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Possible upgrade path for given patch version.""" + + @overload + def __init__( + self, + *, + upgrades: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class KubernetesResourceObjectEncryptionProfile(_Model): # pylint: disable=name-too-long + """Encryption at rest of Kubernetes resource objects using service-managed keys. More information + on this can be found under `https://aka.ms/aks/kubernetesResourceObjectEncryption + `_. + + :ivar infrastructure_encryption: Whether to enable encryption at rest of Kubernetes resource + objects using service-managed keys. More information on this can be found under + `https://aka.ms/aks/kubernetesResourceObjectEncryption + `_. Known values are: "Enabled" and + "Disabled". + :vartype infrastructure_encryption: str or + ~azure.mgmt.containerservice.models.InfrastructureEncryption + """ + + infrastructure_encryption: Optional[Union[str, "_models.InfrastructureEncryption"]] = rest_field( + name="infrastructureEncryption", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to enable encryption at rest of Kubernetes resource objects using service-managed keys. + More information on this can be found under + `https://aka.ms/aks/kubernetesResourceObjectEncryption + `_. Known values are: \"Enabled\" and + \"Disabled\".""" + + @overload + def __init__( + self, + *, + infrastructure_encryption: Optional[Union[str, "_models.InfrastructureEncryption"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class KubernetesVersion(_Model): + """Kubernetes version profile for given major.minor release. + + :ivar version: major.minor version of Kubernetes release. + :vartype version: str + :ivar capabilities: Capabilities on this Kubernetes version. + :vartype capabilities: ~azure.mgmt.containerservice.models.KubernetesVersionCapabilities + :ivar is_default: Whether this version is default. + :vartype is_default: bool + :ivar is_preview: Whether this version is in preview mode. + :vartype is_preview: bool + :ivar patch_versions: Patch versions of Kubernetes release. + :vartype patch_versions: dict[str, ~azure.mgmt.containerservice.models.KubernetesPatchVersion] + """ + + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """major.minor version of Kubernetes release.""" + capabilities: Optional["_models.KubernetesVersionCapabilities"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Capabilities on this Kubernetes version.""" + is_default: Optional[bool] = rest_field( + name="isDefault", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether this version is default.""" + is_preview: Optional[bool] = rest_field( + name="isPreview", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether this version is in preview mode.""" + patch_versions: Optional[dict[str, "_models.KubernetesPatchVersion"]] = rest_field( + name="patchVersions", visibility=["read", "create", "update", "delete", "query"] + ) + """Patch versions of Kubernetes release.""" + + @overload + def __init__( + self, + *, + version: Optional[str] = None, + capabilities: Optional["_models.KubernetesVersionCapabilities"] = None, + is_default: Optional[bool] = None, + is_preview: Optional[bool] = None, + patch_versions: Optional[dict[str, "_models.KubernetesPatchVersion"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class KubernetesVersionCapabilities(_Model): + """Capabilities on this Kubernetes version. + + :ivar support_plan: Kubernetes support plans available for this version. + :vartype support_plan: list[str or ~azure.mgmt.containerservice.models.KubernetesSupportPlan] + """ + + support_plan: Optional[list[Union[str, "_models.KubernetesSupportPlan"]]] = rest_field( + name="supportPlan", visibility=["read", "create", "update", "delete", "query"] + ) + """Kubernetes support plans available for this version.""" + + @overload + def __init__( + self, + *, + support_plan: Optional[list[Union[str, "_models.KubernetesSupportPlan"]]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class KubernetesVersionListResult(_Model): + """Hold values properties, which is array of KubernetesVersion. + + :ivar values_property: Array of AKS supported Kubernetes versions. + :vartype values_property: list[~azure.mgmt.containerservice.models.KubernetesVersion] + """ + + values_property: Optional[list["_models.KubernetesVersion"]] = rest_field( + name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values" + ) + """Array of AKS supported Kubernetes versions.""" + + @overload + def __init__( + self, + *, + values_property: Optional[list["_models.KubernetesVersion"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LabelSelector(_Model): + """A label selector is a label query over a set of resources. The result of matchLabels and + matchExpressions are ANDed. An empty label selector matches all objects. A null label selector + matches no objects. + + :ivar match_labels: matchLabels is an array of {key=value} pairs. A single {key=value} in the + matchLabels map is equivalent to an element of matchExpressions, whose key field is ``key``, + the operator is ``In``, and the values array contains only ``value``. The requirements are + ANDed. + :vartype match_labels: list[str] + :ivar match_expressions: matchExpressions is a list of label selector requirements. The + requirements are ANDed. + :vartype match_expressions: list[~azure.mgmt.containerservice.models.LabelSelectorRequirement] + """ + + match_labels: Optional[list[str]] = rest_field( + name="matchLabels", visibility=["read", "create", "update", "delete", "query"] + ) + """matchLabels is an array of {key=value} pairs. A single {key=value} in the matchLabels map is + equivalent to an element of matchExpressions, whose key field is ``key``, the operator is + ``In``, and the values array contains only ``value``. The requirements are ANDed.""" + match_expressions: Optional[list["_models.LabelSelectorRequirement"]] = rest_field( + name="matchExpressions", visibility=["read", "create", "update", "delete", "query"] + ) + """matchExpressions is a list of label selector requirements. The requirements are ANDed.""" + + @overload + def __init__( + self, + *, + match_labels: Optional[list[str]] = None, + match_expressions: Optional[list["_models.LabelSelectorRequirement"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LabelSelectorRequirement(_Model): + """A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + + :ivar key: key is the label key that the selector applies to. + :vartype key: str + :ivar operator: operator represents a key's relationship to a set of values. Valid operators + are In and NotIn. Known values are: "In", "NotIn", "Exists", and "DoesNotExist". + :vartype operator: str or ~azure.mgmt.containerservice.models.Operator + :ivar values_property: values is an array of string values, the values array must be non-empty. + :vartype values_property: list[str] + """ + + key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """key is the label key that the selector applies to.""" + operator: Optional[Union[str, "_models.Operator"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """operator represents a key's relationship to a set of values. Valid operators are In and NotIn. + Known values are: \"In\", \"NotIn\", \"Exists\", and \"DoesNotExist\".""" + values_property: Optional[list[str]] = rest_field( + name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values" + ) + """values is an array of string values, the values array must be non-empty.""" + + @overload + def __init__( + self, + *, + key: Optional[str] = None, + operator: Optional[Union[str, "_models.Operator"]] = None, + values_property: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LinuxOSConfig(_Model): + """OS configurations of Linux agent nodes. See `AKS custom node configuration + `_ for more details. + + :ivar sysctls: Sysctl settings for Linux agent nodes. + :vartype sysctls: ~azure.mgmt.containerservice.models.SysctlConfig + :ivar transparent_huge_page_enabled: Whether transparent hugepages are 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: Whether the kernel should make aggressive use of memory + compaction to make more hugepages available. 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 + """ + + sysctls: Optional["_models.SysctlConfig"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sysctl settings for Linux agent nodes.""" + transparent_huge_page_enabled: Optional[str] = rest_field( + name="transparentHugePageEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether transparent hugepages are enabled. Valid values are 'always', 'madvise', and 'never'. + The default is 'always'. For more information see `Transparent Hugepages + `_.""" + transparent_huge_page_defrag: Optional[str] = rest_field( + name="transparentHugePageDefrag", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the kernel should make aggressive use of memory compaction to make more hugepages + available. Valid values are 'always', 'defer', 'defer+madvise', 'madvise' and 'never'. The + default is 'madvise'. For more information see `Transparent Hugepages + `_.""" + swap_file_size_mb: Optional[int] = rest_field( + name="swapFileSizeMB", visibility=["read", "create", "update", "delete", "query"] + ) + """The size in MB of a swap file that will be created on each node.""" + + @overload + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LoadBalancer(ProxyResource): + """The configurations regarding multiple standard load balancers. If not supplied, single load + balancer mode will be used. Multiple standard load balancers mode will be used if at lease one + configuration is supplied. There has to be a configuration named ``kubernetes``. The name field + will be the name of the corresponding public load balancer. There will be an internal load + balancer created if needed, and the name will be ``-internal``. The internal lb shares + the same configurations as the external one. The internal lbs are not needed to be included in + LoadBalancer list. + + :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.models.SystemData + :ivar properties: The properties of the load balancer. + :vartype properties: ~azure.mgmt.containerservice.models.LoadBalancerProperties + """ + + properties: Optional["_models.LoadBalancerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The properties of the load balancer.""" + + __flattened_items = [ + "primary_agent_pool_name", + "allow_service_placement", + "service_label_selector", + "service_namespace_selector", + "node_selector", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.LoadBalancerProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class LoadBalancerProperties(_Model): + """Properties for a load balancer resource. + + :ivar primary_agent_pool_name: Required field. A string value that must specify the ID of an + existing agent pool. All nodes in the given pool will always be added to this load balancer. + This agent pool must have at least one node and minCount>=1 for autoscaling operations. An + agent pool can only be the primary pool for a single load balancer. Required. + :vartype primary_agent_pool_name: str + :ivar allow_service_placement: Whether to automatically place services on the load balancer. If + not supplied, the default value is true. If set to false manually, both of the external and the + internal load balancer will not be selected for services unless they explicitly target it. + :vartype allow_service_placement: bool + :ivar service_label_selector: Only services that must match this selector can be placed on this + load balancer. + :vartype service_label_selector: ~azure.mgmt.containerservice.models.LabelSelector + :ivar service_namespace_selector: Services created in namespaces that match the selector can be + placed on this load balancer. + :vartype service_namespace_selector: ~azure.mgmt.containerservice.models.LabelSelector + :ivar node_selector: Nodes that match this selector will be possible members of this load + balancer. + :vartype node_selector: ~azure.mgmt.containerservice.models.LabelSelector + :ivar provisioning_state: The current provisioning state. + :vartype provisioning_state: str + """ + + primary_agent_pool_name: str = rest_field( + name="primaryAgentPoolName", visibility=["read", "create", "update", "delete", "query"] + ) + """Required field. A string value that must specify the ID of an existing agent pool. All nodes in + the given pool will always be added to this load balancer. This agent pool must have at least + one node and minCount>=1 for autoscaling operations. An agent pool can only be the primary pool + for a single load balancer. Required.""" + allow_service_placement: Optional[bool] = rest_field( + name="allowServicePlacement", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to automatically place services on the load balancer. If not supplied, the default + value is true. If set to false manually, both of the external and the internal load balancer + will not be selected for services unless they explicitly target it.""" + service_label_selector: Optional["_models.LabelSelector"] = rest_field( + name="serviceLabelSelector", visibility=["read", "create", "update", "delete", "query"] + ) + """Only services that must match this selector can be placed on this load balancer.""" + service_namespace_selector: Optional["_models.LabelSelector"] = rest_field( + name="serviceNamespaceSelector", visibility=["read", "create", "update", "delete", "query"] + ) + """Services created in namespaces that match the selector can be placed on this load balancer.""" + node_selector: Optional["_models.LabelSelector"] = rest_field( + name="nodeSelector", visibility=["read", "create", "update", "delete", "query"] + ) + """Nodes that match this selector will be possible members of this load balancer.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The current provisioning state.""" + + @overload + def __init__( + self, + *, + primary_agent_pool_name: str, + allow_service_placement: Optional[bool] = None, + service_label_selector: Optional["_models.LabelSelector"] = None, + service_namespace_selector: Optional["_models.LabelSelector"] = None, + node_selector: Optional["_models.LabelSelector"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LocalDNSOverride(_Model): + """Overrides for localDNS profile. + + :ivar query_logging: Log level for DNS queries in localDNS. Known values are: "Error" and + "Log". + :vartype query_logging: str or ~azure.mgmt.containerservice.models.LocalDNSQueryLogging + :ivar protocol: Enforce TCP or prefer UDP protocol for connections from localDNS to upstream + DNS server. Known values are: "PreferUDP" and "ForceTCP". + :vartype protocol: str or ~azure.mgmt.containerservice.models.LocalDNSProtocol + :ivar forward_destination: Destination server for DNS queries to be forwarded from localDNS. + Known values are: "ClusterCoreDNS" and "VnetDNS". + :vartype forward_destination: str or + ~azure.mgmt.containerservice.models.LocalDNSForwardDestination + :ivar forward_policy: Forward policy for selecting upstream DNS server. See `forward plugin + `_ for more information. Known values are: "Sequential", + "RoundRobin", and "Random". + :vartype forward_policy: str or ~azure.mgmt.containerservice.models.LocalDNSForwardPolicy + :ivar max_concurrent: Maximum number of concurrent queries. See `forward plugin + `_ for more information. + :vartype max_concurrent: int + :ivar cache_duration_in_seconds: Cache max TTL in seconds. See `cache plugin + `_ for more information. + :vartype cache_duration_in_seconds: int + :ivar serve_stale_duration_in_seconds: Serve stale duration in seconds. See `cache plugin + `_ for more information. + :vartype serve_stale_duration_in_seconds: int + :ivar serve_stale: Policy for serving stale data. See `cache plugin + `_ for more information. Known values are: "Verify", + "Immediate", and "Disable". + :vartype serve_stale: str or ~azure.mgmt.containerservice.models.LocalDNSServeStale + """ + + query_logging: Optional[Union[str, "_models.LocalDNSQueryLogging"]] = rest_field( + name="queryLogging", visibility=["read", "create", "update", "delete", "query"] + ) + """Log level for DNS queries in localDNS. Known values are: \"Error\" and \"Log\".""" + protocol: Optional[Union[str, "_models.LocalDNSProtocol"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Enforce TCP or prefer UDP protocol for connections from localDNS to upstream DNS server. Known + values are: \"PreferUDP\" and \"ForceTCP\".""" + forward_destination: Optional[Union[str, "_models.LocalDNSForwardDestination"]] = rest_field( + name="forwardDestination", visibility=["read", "create", "update", "delete", "query"] + ) + """Destination server for DNS queries to be forwarded from localDNS. Known values are: + \"ClusterCoreDNS\" and \"VnetDNS\".""" + forward_policy: Optional[Union[str, "_models.LocalDNSForwardPolicy"]] = rest_field( + name="forwardPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Forward policy for selecting upstream DNS server. See `forward plugin + `_ for more information. Known values are: \"Sequential\", + \"RoundRobin\", and \"Random\".""" + max_concurrent: Optional[int] = rest_field( + name="maxConcurrent", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of concurrent queries. See `forward plugin + `_ for more information.""" + cache_duration_in_seconds: Optional[int] = rest_field( + name="cacheDurationInSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """Cache max TTL in seconds. See `cache plugin `_ for more + information.""" + serve_stale_duration_in_seconds: Optional[int] = rest_field( + name="serveStaleDurationInSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """Serve stale duration in seconds. See `cache plugin `_ for + more information.""" + serve_stale: Optional[Union[str, "_models.LocalDNSServeStale"]] = rest_field( + name="serveStale", visibility=["read", "create", "update", "delete", "query"] + ) + """Policy for serving stale data. See `cache plugin `_ for more + information. Known values are: \"Verify\", \"Immediate\", and \"Disable\".""" + + @overload + def __init__( + self, + *, + query_logging: Optional[Union[str, "_models.LocalDNSQueryLogging"]] = None, + protocol: Optional[Union[str, "_models.LocalDNSProtocol"]] = None, + forward_destination: Optional[Union[str, "_models.LocalDNSForwardDestination"]] = None, + forward_policy: Optional[Union[str, "_models.LocalDNSForwardPolicy"]] = None, + max_concurrent: Optional[int] = None, + cache_duration_in_seconds: Optional[int] = None, + serve_stale_duration_in_seconds: Optional[int] = None, + serve_stale: Optional[Union[str, "_models.LocalDNSServeStale"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LocalDNSProfile(_Model): + """Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS helps improve + performance and reliability of DNS resolution in an AKS cluster. For more details see + aka.ms/aks/localdns. + + :ivar mode: Mode of enablement for localDNS. Known values are: "Preferred", "Required", and + "Disabled". + :vartype mode: str or ~azure.mgmt.containerservice.models.LocalDNSMode + :ivar state: System-generated state of localDNS. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.containerservice.models.LocalDNSState + :ivar vnet_dns_overrides: VnetDNS overrides apply to DNS traffic from pods with + dnsPolicy:default or kubelet (referred to as VnetDNS traffic). + :vartype vnet_dns_overrides: dict[str, ~azure.mgmt.containerservice.models.LocalDNSOverride] + :ivar kube_dns_overrides: KubeDNS overrides apply to DNS traffic from pods with + dnsPolicy:ClusterFirst (referred to as KubeDNS traffic). + :vartype kube_dns_overrides: dict[str, ~azure.mgmt.containerservice.models.LocalDNSOverride] + """ + + mode: Optional[Union[str, "_models.LocalDNSMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Mode of enablement for localDNS. Known values are: \"Preferred\", \"Required\", and + \"Disabled\".""" + state: Optional[Union[str, "_models.LocalDNSState"]] = rest_field(visibility=["read"]) + """System-generated state of localDNS. Known values are: \"Enabled\" and \"Disabled\".""" + vnet_dns_overrides: Optional[dict[str, "_models.LocalDNSOverride"]] = rest_field( + name="vnetDNSOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """VnetDNS overrides apply to DNS traffic from pods with dnsPolicy:default or kubelet (referred to + as VnetDNS traffic).""" + kube_dns_overrides: Optional[dict[str, "_models.LocalDNSOverride"]] = rest_field( + name="kubeDNSOverrides", visibility=["read", "create", "update", "delete", "query"] + ) + """KubeDNS overrides apply to DNS traffic from pods with dnsPolicy:ClusterFirst (referred to as + KubeDNS traffic).""" + + @overload + def __init__( + self, + *, + mode: Optional[Union[str, "_models.LocalDNSMode"]] = None, + vnet_dns_overrides: Optional[dict[str, "_models.LocalDNSOverride"]] = None, + kube_dns_overrides: Optional[dict[str, "_models.LocalDNSOverride"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Machine(ProxyResource): + """A machine. Contains details about the underlying virtual machine. A machine may be visible here + but not in kubectl get nodes; if so it may be because the machine has not been registered with + the Kubernetes API Server yet. + + :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.models.SystemData + :ivar properties: The properties of the machine. + :vartype properties: ~azure.mgmt.containerservice.models.MachineProperties + :ivar zones: The Availability zone in which machine is located. + :vartype zones: list[str] + """ + + properties: Optional["_models.MachineProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The properties of the machine.""" + zones: Optional[list[str]] = rest_field(visibility=["read"]) + """The Availability zone in which machine is located.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.MachineProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MachineHardwareProfile(_Model): + """The hardware and GPU settings of the machine. + + :ivar vm_size: The size of the VM. 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 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.models.GPUInstanceProfile + :ivar gpu_profile: The GPU settings of the machine. + :vartype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile + """ + + vm_size: Optional[str] = rest_field(name="vmSize", visibility=["read", "create", "update", "delete", "query"]) + """The size of the VM. 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 + `_.""" + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = rest_field( + name="gpuInstanceProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + Known values are: \"MIG1g\", \"MIG2g\", \"MIG3g\", \"MIG4g\", and \"MIG7g\".""" + gpu_profile: Optional["_models.GPUProfile"] = rest_field( + name="gpuProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The GPU settings of the machine.""" + + @overload + def __init__( + self, + *, + vm_size: Optional[str] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + gpu_profile: Optional["_models.GPUProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MachineIpAddress(_Model): + """The machine IP address details. + + :ivar family: To determine if address belongs IPv4 or IPv6 family. Known values are: "IPv4" and + "IPv6". + :vartype family: str or ~azure.mgmt.containerservice.models.IPFamily + :ivar ip: IPv4 or IPv6 address of the machine. + :vartype ip: str + """ + + family: Optional[Union[str, "_models.IPFamily"]] = rest_field(visibility=["read"]) + """To determine if address belongs IPv4 or IPv6 family. Known values are: \"IPv4\" and \"IPv6\".""" + ip: Optional[str] = rest_field(visibility=["read"]) + """IPv4 or IPv6 address of the machine.""" + + +class MachineKubernetesProfile(_Model): + """The Kubernetes configurations used by the machine. + + :ivar node_labels: The node labels on the machine. + :vartype node_labels: dict[str, str] + :ivar orchestrator_version: The version of Kubernetes specified by the user. Both patch version + and are supported. When is specified, the + latest supported patch version is chosen automatically. + :vartype orchestrator_version: str + :ivar current_orchestrator_version: The version of Kubernetes running on the machine. 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 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.models.KubeletDiskType + :ivar kubelet_config: The Kubelet configuration on the machine. + :vartype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig + :ivar node_initialization_taints: Taints added on the node during creation that will not be + reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl + call. These taints allow for required configuration to run before the node is ready to accept + workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl taint + nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :ivar node_taints: The taints added to new node during machine create. For example, + key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar node_name: The node name in the Kubernetes cluster. + :vartype node_name: str + :ivar workload_runtime: Determines the type of workload a node can run. Known values are: + "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". + :vartype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile + """ + + node_labels: Optional[dict[str, str]] = rest_field( + name="nodeLabels", visibility=["read", "create", "update", "delete", "query"] + ) + """The node labels on the machine.""" + orchestrator_version: Optional[str] = rest_field( + name="orchestratorVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The version of Kubernetes specified by the user. Both patch version and + are supported. When is specified, the latest supported patch + version is chosen automatically.""" + current_orchestrator_version: Optional[str] = rest_field(name="currentOrchestratorVersion", visibility=["read"]) + """The version of Kubernetes running on the machine. 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.""" + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = rest_field( + name="kubeletDiskType", visibility=["read", "create", "update", "delete", "query"] + ) + """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet + ephemeral storage. Known values are: \"OS\" and \"Temporary\".""" + kubelet_config: Optional["_models.KubeletConfig"] = rest_field( + name="kubeletConfig", visibility=["read", "create", "update", "delete", "query"] + ) + """The Kubelet configuration on the machine.""" + node_initialization_taints: Optional[list[str]] = rest_field( + name="nodeInitializationTaints", visibility=["read", "create", "update", "delete", "query"] + ) + """Taints added on the node during creation that will not be reconciled by AKS. These taints will + not be reconciled by AKS and can be removed with a kubectl call. These taints allow for + required configuration to run before the node is ready to accept workloads, for example + 'key1=value1:NoSchedule' that then can be removed with ``kubectl taint nodes node1 + key1=value1:NoSchedule-``.""" + node_taints: Optional[list[str]] = rest_field( + name="nodeTaints", visibility=["read", "create", "update", "delete", "query"] + ) + """The taints added to new node during machine create. For example, key=value:NoSchedule.""" + max_pods: Optional[int] = rest_field(name="maxPods", visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of pods that can run on a node.""" + node_name: Optional[str] = rest_field(name="nodeName", visibility=["read"]) + """The node name in the Kubernetes cluster.""" + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = rest_field( + name="workloadRuntime", visibility=["read", "create", "update", "delete", "query"] + ) + """Determines the type of workload a node can run. Known values are: \"OCIContainer\", + \"WasmWasi\", \"KataMshvVmIsolation\", and \"KataVmIsolation\".""" + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = rest_field( + name="artifactStreamingProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for using artifact streaming on AKS.""" + + @overload + def __init__( + self, + *, + node_labels: Optional[dict[str, str]] = None, + orchestrator_version: Optional[str] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + node_initialization_taints: Optional[list[str]] = None, + node_taints: Optional[list[str]] = None, + max_pods: Optional[int] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MachineNetworkProperties(_Model): + """network properties of the machine. + + :ivar ip_addresses: IPv4, IPv6 addresses of the machine. + :vartype ip_addresses: list[~azure.mgmt.containerservice.models.MachineIpAddress] + :ivar vnet_subnet_id: The ID of the subnet which node and optionally pods will join on startup. + 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: The ID of the subnet which pods will join when launched. 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 enable_node_public_ip: Whether the machine is allocated its own public IP. Some scenarios + may require the machine 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. The default is false. + :vartype enable_node_public_ip: bool + :ivar node_public_ip_prefix_id: The public IP prefix ID which VM node should use IPs from. This + is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. + :vartype node_public_ip_prefix_id: str + :ivar node_public_ip_tags: IPTags of instance-level public IPs. + :vartype node_public_ip_tags: list[~azure.mgmt.containerservice.models.IPTag] + """ + + ip_addresses: Optional[list["_models.MachineIpAddress"]] = rest_field(name="ipAddresses", visibility=["read"]) + """IPv4, IPv6 addresses of the machine.""" + vnet_subnet_id: Optional[str] = rest_field( + name="vnetSubnetID", visibility=["read", "create", "update", "delete", "query"] + ) + """The ID of the subnet which node and optionally pods will join on startup. 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}.""" + pod_subnet_id: Optional[str] = rest_field( + name="podSubnetID", visibility=["read", "create", "update", "delete", "query"] + ) + """The ID of the subnet which pods will join when launched. 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}.""" + enable_node_public_ip: Optional[bool] = rest_field( + name="enableNodePublicIP", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the machine is allocated its own public IP. Some scenarios may require the machine 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. + The default is false.""" + node_public_ip_prefix_id: Optional[str] = rest_field( + name="nodePublicIPPrefixID", visibility=["read", "create", "update", "delete", "query"] + ) + """The public IP prefix ID which VM node should use IPs from. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}.""" + node_public_ip_tags: Optional[list["_models.IPTag"]] = rest_field( + name="nodePublicIPTags", visibility=["read", "create", "update", "delete", "query"] + ) + """IPTags of instance-level public IPs.""" + + @overload + def __init__( + self, + *, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + node_public_ip_tags: Optional[list["_models.IPTag"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MachineOSProfile(_Model): + """The operating system and disk used by the machine. + + :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.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", + "AzureLinux", "AzureLinux3", "Mariner", "Flatcar", "CBLMariner", "Windows2019", "Windows2022", + "Ubuntu2204", "Windows2025", "WindowsAnnual", and "Ubuntu2404". + :vartype os_sku: str or ~azure.mgmt.containerservice.models.OSSKU + :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 OS disk type to be used for machines in the agent pool. 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.models.OSDiskType + :ivar enable_fips: Whether to use a FIPS-enabled OS. + :vartype enable_fips: bool + :ivar linux_profile: The Linux machine's specific profile. + :vartype linux_profile: ~azure.mgmt.containerservice.models.MachineOSProfileLinuxProfile + :ivar windows_profile: The Windows machine's specific profile. + :vartype windows_profile: ~azure.mgmt.containerservice.models.AgentPoolWindowsProfile + """ + + os_type: Optional[Union[str, "_models.OSType"]] = rest_field( + name="osType", visibility=["read", "create", "update", "delete", "query"] + ) + """The operating system type. The default is Linux. Known values are: \"Linux\" and \"Windows\".""" + os_sku: Optional[Union[str, "_models.OSSKU"]] = rest_field( + name="osSKU", visibility=["read", "create", "update", "delete", "query"] + ) + """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\", \"AzureLinux\", + \"AzureLinux3\", \"Mariner\", \"Flatcar\", \"CBLMariner\", \"Windows2019\", \"Windows2022\", + \"Ubuntu2204\", \"Windows2025\", \"WindowsAnnual\", and \"Ubuntu2404\".""" + os_disk_size_gb: Optional[int] = rest_field( + name="osDiskSizeGB", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = rest_field( + name="osDiskType", visibility=["read", "create", "update", "delete", "query"] + ) + """The OS disk type to be used for machines in the agent pool. 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\".""" + enable_fips: Optional[bool] = rest_field( + name="enableFIPS", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to use a FIPS-enabled OS.""" + linux_profile: Optional["_models.MachineOSProfileLinuxProfile"] = rest_field( + name="linuxProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The Linux machine's specific profile.""" + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = rest_field( + name="windowsProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The Windows machine's specific profile.""" + + @overload + def __init__( + self, + *, + os_type: Optional[Union[str, "_models.OSType"]] = None, + os_sku: Optional[Union[str, "_models.OSSKU"]] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + enable_fips: Optional[bool] = None, + linux_profile: Optional["_models.MachineOSProfileLinuxProfile"] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MachineOSProfileLinuxProfile(_Model): + """The Linux machine's specific profile. + + :ivar linux_os_config: The OS configuration of Linux machine. + :vartype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig + :ivar message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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 + """ + + linux_os_config: Optional["_models.LinuxOSConfig"] = rest_field( + name="linuxOSConfig", visibility=["read", "create", "update", "delete", "query"] + ) + """The OS configuration of Linux machine.""" + message_of_the_day: Optional[str] = rest_field( + name="messageOfTheDay", visibility=["read", "create", "update", "delete", "query"] + ) + """Message of the day for Linux nodes, base64-encoded. 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).""" + + @overload + def __init__( + self, + *, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + message_of_the_day: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MachineProperties(_Model): + """The properties of the machine. + + :ivar network: network properties of the machine. + :vartype network: ~azure.mgmt.containerservice.models.MachineNetworkProperties + :ivar resource_id: Azure resource id of the machine. It can be used to GET underlying VM + Instance. + :vartype resource_id: str + :ivar hardware: The hardware and GPU settings of the machine. + :vartype hardware: ~azure.mgmt.containerservice.models.MachineHardwareProfile + :ivar operating_system: The operating system and disk used by the machine. + :vartype operating_system: ~azure.mgmt.containerservice.models.MachineOSProfile + :ivar kubernetes: The Kubernetes configurations used by the machine. + :vartype kubernetes: ~azure.mgmt.containerservice.models.MachineKubernetesProfile + :ivar mode: Machine only allows 'System' and 'User' mode. Known values are: "System", "User", + "Gateway", "ManagedSystem", and "Machines". + :vartype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode + :ivar security: The security settings of the machine. + :vartype security: ~azure.mgmt.containerservice.models.MachineSecurityProfile + :ivar priority: The priority for the machine. If not specified, the default is 'Regular'. Known + values are: "Spot" and "Regular". + :vartype priority: str or ~azure.mgmt.containerservice.models.ScaleSetPriority + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar tags: The tags to be persisted on the machine. + :vartype tags: dict[str, str] + :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value + will change when the resource is updated. Specify an if-match or if-none-match header with the + eTag value for a subsequent request to enable optimistic concurrency per the normal eTag + convention. + :vartype e_tag: str + :ivar status: Contains read-only information about the machine. + :vartype status: ~azure.mgmt.containerservice.models.MachineStatus + """ + + network: Optional["_models.MachineNetworkProperties"] = rest_field(visibility=["read"]) + """network properties of the machine.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Azure resource id of the machine. It can be used to GET underlying VM Instance.""" + hardware: Optional["_models.MachineHardwareProfile"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The hardware and GPU settings of the machine.""" + operating_system: Optional["_models.MachineOSProfile"] = rest_field( + name="operatingSystem", visibility=["read", "create", "update", "delete", "query"] + ) + """The operating system and disk used by the machine.""" + kubernetes: Optional["_models.MachineKubernetesProfile"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Kubernetes configurations used by the machine.""" + mode: Optional[Union[str, "_models.AgentPoolMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Machine only allows 'System' and 'User' mode. Known values are: \"System\", \"User\", + \"Gateway\", \"ManagedSystem\", and \"Machines\".""" + security: Optional["_models.MachineSecurityProfile"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The security settings of the machine.""" + priority: Optional[Union[str, "_models.ScaleSetPriority"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The priority for the machine. If not specified, the default is 'Regular'. Known values are: + \"Spot\" and \"Regular\".""" + node_image_version: Optional[str] = rest_field(name="nodeImageVersion", visibility=["read"]) + """The version of node image.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The current deployment or provisioning state.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tags to be persisted on the machine.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """Unique read-only string used to implement optimistic concurrency. The eTag value will change + when the resource is updated. Specify an if-match or if-none-match header with the eTag value + for a subsequent request to enable optimistic concurrency per the normal eTag convention.""" + status: Optional["_models.MachineStatus"] = rest_field(visibility=["read"]) + """Contains read-only information about the machine.""" + + @overload + def __init__( + self, + *, + hardware: Optional["_models.MachineHardwareProfile"] = None, + operating_system: Optional["_models.MachineOSProfile"] = None, + kubernetes: Optional["_models.MachineKubernetesProfile"] = None, + mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, + security: Optional["_models.MachineSecurityProfile"] = None, + priority: Optional[Union[str, "_models.ScaleSetPriority"]] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MachineSecurityProfile(_Model): + """The security settings of the machine. + + :ivar enable_vtpm: vTPM is a Trusted Launch feature for configuring a dedicated secure vault + for keys and measurements held locally on the node. For more details, see + aka.ms/aks/trustedlaunch. If not specified, the default is false. + :vartype enable_vtpm: bool + :ivar enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only + signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. + If not specified, the default is false. + :vartype enable_secure_boot: bool + :ivar ssh_access: SSH access method of an agent pool. Known values are: "LocalUser", + "Disabled", and "EntraId". + :vartype ssh_access: str or ~azure.mgmt.containerservice.models.AgentPoolSSHAccess + :ivar enable_encryption_at_host: Whether to enable host based OS and data drive encryption. + 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 + """ + + enable_vtpm: Optional[bool] = rest_field( + name="enableVTPM", visibility=["read", "create", "update", "delete", "query"] + ) + """vTPM is a Trusted Launch feature for configuring a dedicated secure vault for keys and + measurements held locally on the node. For more details, see aka.ms/aks/trustedlaunch. If not + specified, the default is false.""" + enable_secure_boot: Optional[bool] = rest_field( + name="enableSecureBoot", visibility=["read", "create", "update", "delete", "query"] + ) + """Secure Boot is a feature of Trusted Launch which ensures that only signed operating systems and + drivers can boot. For more details, see aka.ms/aks/trustedlaunch. If not specified, the + default is false.""" + ssh_access: Optional[Union[str, "_models.AgentPoolSSHAccess"]] = rest_field( + name="sshAccess", visibility=["read", "create", "update", "delete", "query"] + ) + """SSH access method of an agent pool. Known values are: \"LocalUser\", \"Disabled\", and + \"EntraId\".""" + enable_encryption_at_host: Optional[bool] = rest_field( + name="enableEncryptionAtHost", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to enable host based OS and data drive encryption. 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 + `_.""" + + @overload + def __init__( + self, + *, + enable_vtpm: Optional[bool] = None, + enable_secure_boot: Optional[bool] = None, + ssh_access: Optional[Union[str, "_models.AgentPoolSSHAccess"]] = None, + enable_encryption_at_host: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MachineStatus(_Model): + """Contains read-only information about the machine. + + :ivar provisioning_error: The error details information of the machine. Preserves the detailed + info of failure. If there was no error, this field is omitted. + :vartype provisioning_error: ~azure.mgmt.containerservice.models.ErrorDetail + :ivar creation_timestamp: Specifies the time at which the machine was created. + :vartype creation_timestamp: ~datetime.datetime + :ivar drift_action: The drift action of the machine. Indicates whether a machine has deviated + from its expected state due to changes in managed cluster properties, requiring corrective + action. Known values are: "Synced" and "Recreate". + :vartype drift_action: str or ~azure.mgmt.containerservice.models.DriftAction + :ivar drift_reason: Reason for machine drift. Provides detailed information on why the machine + has drifted. This field is omitted if the machine is up to date. + :vartype drift_reason: str + :ivar vm_state: Virtual machine state. Indicates the current state of the underlying virtual + machine. Known values are: "Running" and "Deleted". + :vartype vm_state: str or ~azure.mgmt.containerservice.models.VmState + """ + + provisioning_error: Optional["_models.ErrorDetail"] = rest_field(name="provisioningError", visibility=["read"]) + """The error details information of the machine. Preserves the detailed info of failure. If there + was no error, this field is omitted.""" + creation_timestamp: Optional[datetime.datetime] = rest_field( + name="creationTimestamp", visibility=["read"], format="rfc3339" + ) + """Specifies the time at which the machine was created.""" + drift_action: Optional[Union[str, "_models.DriftAction"]] = rest_field(name="driftAction", visibility=["read"]) + """The drift action of the machine. Indicates whether a machine has deviated from its expected + state due to changes in managed cluster properties, requiring corrective action. Known values + are: \"Synced\" and \"Recreate\".""" + drift_reason: Optional[str] = rest_field(name="driftReason", visibility=["read"]) + """Reason for machine drift. Provides detailed information on why the machine has drifted. This + field is omitted if the machine is up to date.""" + vm_state: Optional[Union[str, "_models.VmState"]] = rest_field(name="vmState", visibility=["read"]) + """Virtual machine state. Indicates the current state of the underlying virtual machine. Known + values are: \"Running\" and \"Deleted\".""" + + +class MaintenanceConfiguration(ProxyResource): + """Planned maintenance configuration, used to configure when updates can be deployed to a Managed + Cluster. See `planned maintenance `_ + for more information about planned maintenance. + + :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.models.SystemData + :ivar properties: Properties of a default maintenance configuration. + :vartype properties: ~azure.mgmt.containerservice.models.MaintenanceConfigurationProperties + """ + + properties: Optional["_models.MaintenanceConfigurationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of a default maintenance configuration.""" + + __flattened_items = ["time_in_week", "not_allowed_time", "maintenance_window"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.MaintenanceConfigurationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class MaintenanceConfigurationProperties(_Model): + """Properties used to configure planned maintenance for a Managed Cluster. + + :ivar time_in_week: Time slots during the week when planned maintenance is allowed to proceed. + 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.models.TimeInWeek] + :ivar not_allowed_time: Time slots on which upgrade is not allowed. + :vartype not_allowed_time: list[~azure.mgmt.containerservice.models.TimeSpan] + :ivar maintenance_window: Maintenance window for the maintenance configuration. + :vartype maintenance_window: ~azure.mgmt.containerservice.models.MaintenanceWindow + """ + + time_in_week: Optional[list["_models.TimeInWeek"]] = rest_field( + name="timeInWeek", visibility=["read", "create", "update", "delete", "query"] + ) + """Time slots during the week when planned maintenance is allowed to proceed. If two array entries + specify the same day of the week, the applied configuration is the union of times in both + entries.""" + not_allowed_time: Optional[list["_models.TimeSpan"]] = rest_field( + name="notAllowedTime", visibility=["read", "create", "update", "delete", "query"] + ) + """Time slots on which upgrade is not allowed.""" + maintenance_window: Optional["_models.MaintenanceWindow"] = rest_field( + name="maintenanceWindow", visibility=["read", "create", "update", "delete", "query"] + ) + """Maintenance window for the maintenance configuration.""" + + @overload + def __init__( + self, + *, + time_in_week: Optional[list["_models.TimeInWeek"]] = None, + not_allowed_time: Optional[list["_models.TimeSpan"]] = None, + maintenance_window: Optional["_models.MaintenanceWindow"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceWindow(_Model): + """Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. + + :ivar schedule: Recurrence schedule for the maintenance window. Required. + :vartype schedule: ~azure.mgmt.containerservice.models.Schedule + :ivar duration_hours: Length of maintenance window range from 4 to 24 hours. Required. + :vartype duration_hours: int + :ivar utc_offset: The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' + for PST. If not specified, the default is '+00:00'. + :vartype utc_offset: str + :ivar start_date: The date the maintenance window activates. If the current date is before this + date, the maintenance window is inactive and will not be used for upgrades. If not specified, + the maintenance window will be active right away. + :vartype start_date: ~datetime.date + :ivar start_time: The start time of the maintenance window. Accepted values are from '00:00' to + '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means + UTC time '00:00'. Required. + :vartype start_time: str + :ivar not_allowed_dates: Date ranges on which upgrade is not allowed. 'utcOffset' applies to + this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to + '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC + time. + :vartype not_allowed_dates: list[~azure.mgmt.containerservice.models.DateSpan] + """ + + schedule: "_models.Schedule" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Recurrence schedule for the maintenance window. Required.""" + duration_hours: int = rest_field(name="durationHours", visibility=["read", "create", "update", "delete", "query"]) + """Length of maintenance window range from 4 to 24 hours. Required.""" + utc_offset: Optional[str] = rest_field(name="utcOffset", visibility=["read", "create", "update", "delete", "query"]) + """The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' for PST. If not + specified, the default is '+00:00'.""" + start_date: Optional[datetime.date] = rest_field( + name="startDate", visibility=["read", "create", "update", "delete", "query"] + ) + """The date the maintenance window activates. If the current date is before this date, the + maintenance window is inactive and will not be used for upgrades. If not specified, the + maintenance window will be active right away.""" + start_time: str = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) + """The start time of the maintenance window. Accepted values are from '00:00' to '23:59'. + 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means UTC time + '00:00'. Required.""" + not_allowed_dates: Optional[list["_models.DateSpan"]] = rest_field( + name="notAllowedDates", visibility=["read", "create", "update", "delete", "query"] + ) + """Date ranges on which upgrade is not allowed. 'utcOffset' applies to this field. For example, + with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to '2023-01-03', maintenance will be + blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC time.""" + + @overload + def __init__( + self, + *, + schedule: "_models.Schedule", + duration_hours: int, + start_time: str, + utc_offset: Optional[str] = None, + start_date: Optional[datetime.date] = None, + not_allowed_dates: Optional[list["_models.DateSpan"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TrackedResource(Resource): + """Tracked Resource. + + :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.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedCluster(TrackedResource): + """Managed cluster. + + :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.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 properties: Properties of a managed cluster. + :vartype properties: ~azure.mgmt.containerservice.models.ManagedClusterProperties + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str + :ivar sku: The managed cluster SKU. + :vartype sku: ~azure.mgmt.containerservice.models.ManagedClusterSKU + :ivar extended_location: The extended location of the Virtual Machine. + :vartype extended_location: ~azure.mgmt.containerservice.models.ExtendedLocation + :ivar identity: The identity of the managed cluster, if configured. + :vartype identity: ~azure.mgmt.containerservice.models.ManagedClusterIdentity + :ivar kind: This is primarily used to expose different UI experiences in the portal for + different kinds. + :vartype kind: str + """ + + properties: Optional["_models.ManagedClusterProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of a managed cluster.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + sku: Optional["_models.ManagedClusterSKU"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The managed cluster SKU.""" + extended_location: Optional["_models.ExtendedLocation"] = rest_field( + name="extendedLocation", visibility=["read", "create", "update", "delete", "query"] + ) + """The extended location of the Virtual Machine.""" + identity: Optional["_models.ManagedClusterIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The identity of the managed cluster, if configured.""" + kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """This is primarily used to expose different UI experiences in the portal for different kinds.""" + + __flattened_items = [ + "provisioning_state", + "power_state", + "creation_data", + "max_agent_pools", + "kubernetes_version", + "current_kubernetes_version", + "dns_prefix", + "fqdn_subdomain", + "fqdn", + "private_fqdn", + "azure_portal_fqdn", + "agent_pool_profiles", + "linux_profile", + "windows_profile", + "service_principal_profile", + "addon_profiles", + "pod_identity_profile", + "oidc_issuer_profile", + "node_resource_group", + "node_resource_group_profile", + "enable_rbac", + "support_plan", + "enable_namespace_resources", + "network_profile", + "aad_profile", + "auto_upgrade_profile", + "upgrade_settings", + "auto_scaler_profile", + "api_server_access_profile", + "disk_encryption_set_id", + "identity_profile", + "private_link_resources", + "disable_local_accounts", + "http_proxy_config", + "security_profile", + "storage_profile", + "ingress_profile", + "public_network_access", + "workload_auto_scaler_profile", + "azure_monitor_profile", + "service_mesh_profile", + "resource_uid", + "metrics_profile", + "node_provisioning_profile", + "bootstrap_profile", + "ai_toolchain_operator_profile", + "scheduler_profile", + "hosted_system_profile", + "status", + ] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ManagedClusterProperties"] = None, + sku: Optional["_models.ManagedClusterSKU"] = None, + extended_location: Optional["_models.ExtendedLocation"] = None, + identity: Optional["_models.ManagedClusterIdentity"] = None, + kind: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedClusterAADProfile(_Model): + """AADProfile specifies attributes for Azure Active Directory integration. For more details see + `managed AAD on AKS `_. + + :ivar managed: Whether to enable managed AAD. + :vartype managed: bool + :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. + :vartype enable_azure_rbac: bool + :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of + the cluster. + :vartype admin_group_object_i_ds: list[str] + :ivar client_app_id: (DEPRECATED) The client AAD application ID. Learn more at + `https://aka.ms/aks/aad-legacy `_. + :vartype client_app_id: str + :ivar server_app_id: (DEPRECATED) The server AAD application ID. Learn more at + `https://aka.ms/aks/aad-legacy `_. + :vartype server_app_id: str + :ivar server_app_secret: (DEPRECATED) The server AAD application secret. Learn more at + `https://aka.ms/aks/aad-legacy `_. + :vartype server_app_secret: str + :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the + tenant of the deployment subscription. + :vartype tenant_id: str + """ + + managed: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable managed AAD.""" + enable_azure_rbac: Optional[bool] = rest_field( + name="enableAzureRBAC", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to enable Azure RBAC for Kubernetes authorization.""" + admin_group_object_i_ds: Optional[list[str]] = rest_field( + name="adminGroupObjectIDs", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of AAD group object IDs that will have admin role of the cluster.""" + client_app_id: Optional[str] = rest_field( + name="clientAppID", visibility=["read", "create", "update", "delete", "query"] + ) + """(DEPRECATED) The client AAD application ID. Learn more at `https://aka.ms/aks/aad-legacy + `_.""" + server_app_id: Optional[str] = rest_field( + name="serverAppID", visibility=["read", "create", "update", "delete", "query"] + ) + """(DEPRECATED) The server AAD application ID. Learn more at `https://aka.ms/aks/aad-legacy + `_.""" + server_app_secret: Optional[str] = rest_field( + name="serverAppSecret", visibility=["read", "create", "update", "delete", "query"] + ) + """(DEPRECATED) The server AAD application secret. Learn more at `https://aka.ms/aks/aad-legacy + `_.""" + tenant_id: Optional[str] = rest_field(name="tenantID", visibility=["read", "create", "update", "delete", "query"]) + """The AAD tenant ID to use for authentication. If not specified, will use the tenant of the + deployment subscription.""" + + @overload + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAccessProfile(TrackedResource): + """Managed cluster Access Profile. + + :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.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 properties: AccessProfile of a managed cluster. + :vartype properties: ~azure.mgmt.containerservice.models.AccessProfile + """ + + properties: Optional["_models.AccessProfile"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """AccessProfile of a managed cluster.""" + + __flattened_items = ["kube_config"] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.AccessProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedClusterAddonProfile(_Model): + """A Kubernetes add-on profile for a managed cluster. + + :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.models.ManagedClusterAddonProfileIdentity + """ + + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the add-on is enabled or not. Required.""" + config: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Key-value pairs for configuring an add-on.""" + identity: Optional["_models.ManagedClusterAddonProfileIdentity"] = rest_field(visibility=["read"]) + """Information of user assigned identity used by this add-on.""" + + @overload + def __init__( + self, + *, + enabled: bool, + config: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UserAssignedIdentity(_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 + """ + + resource_id: Optional[str] = rest_field( + name="resourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the user assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) + """The client ID of the user assigned identity.""" + object_id: Optional[str] = rest_field(name="objectId", visibility=["read", "create", "update", "delete", "query"]) + """The object ID of the user assigned identity.""" + + @overload + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class 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 + """ + + @overload + def __init__( + self, + *, + resource_id: Optional[str] = None, + client_id: Optional[str] = None, + object_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAgentPoolProfileProperties(_Model): + """Properties for the container service agent pool profile. + + :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value + will change when the resource is updated. Specify an if-match or if-none-match header with the + eTag value for a subsequent request to enable optimistic concurrency per the normal eTag + convention. + :vartype e_tag: str + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: The size of the agent pool VMs. 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 OS disk type to be used for machines in the agent pool. 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.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.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Known values are: + "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". + :vartype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime + :ivar message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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: The ID of the subnet which agent pool nodes and optionally pods will join + on startup. 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: The ID of the subnet which pods will join when launched. 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 pod_ip_allocation_mode: Pod IP Allocation Mode. The IP allocation mode for pods in the + agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values + are: "DynamicIndividual" and "StaticBlock". + :vartype pod_ip_allocation_mode: str or ~azure.mgmt.containerservice.models.PodIPAllocationMode + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and + "Windows". + :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType + :ivar os_sku: Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is + Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= + 1.25 if OSType is Windows. Known values are: "Ubuntu", "AzureLinux", "AzureLinux3", "Mariner", + "Flatcar", "CBLMariner", "Windows2019", "Windows2022", "Ubuntu2204", "Windows2025", + "WindowsAnnual", and "Ubuntu2404". + :vartype os_sku: str or ~azure.mgmt.containerservice.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: The scale down mode to use when scaling the Agent Pool. 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.models.ScaleDownMode + :ivar type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", + "AvailabilitySet", and "VirtualMachines". + :vartype type: str or ~azure.mgmt.containerservice.models.AgentPoolType + :ivar mode: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at + all times. For additional information on agent pool restrictions and best practices, see: + `https://docs.microsoft.com/azure/aks/use-system-pools + `_. Known values are: "System", "User", + "Gateway", "ManagedSystem", and "Machines". + :vartype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode + :ivar orchestrator_version: The version of Kubernetes specified by the user. Both patch version + (e.g. 1.20.13) and (e.g. 1.20) are supported. When + is specified, the latest supported GA patch version is chosen automatically. + Updating the cluster with the same once it has been created (e.g. 1.14.x -> 1.14) + 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: The version of Kubernetes the Agent Pool is running. If + orchestratorVersion is a fully specified version , this field will be + exactly equal to it. If orchestratorVersion is , 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_strategy: Defines the upgrade strategy for the agent pool. The default is + Rolling. Known values are: "Rolling" and "BlueGreen". + :vartype upgrade_strategy: str or ~azure.mgmt.containerservice.models.UpgradeStrategy + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.models.AgentPoolUpgradeSettings + :ivar upgrade_settings_blue_green: Settings for Blue-Green upgrade on the agentpool. Applies + when upgrade strategy is set to BlueGreen. + :vartype upgrade_settings_blue_green: + ~azure.mgmt.containerservice.models.AgentPoolBlueGreenUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Whether the Agent Pool is running or stopped. 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.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: Whether each node is allocated its own 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 node_public_ip_prefix_id: The public IP prefix ID which VM nodes should use IPs from. + 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. Known values are: "Spot" and + "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.models.ScaleSetPriority + :ivar scale_set_eviction_policy: The Virtual Machine Scale Set eviction policy. 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 + `_. Known values are: "Delete" and + "Deallocate". + :vartype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.models.ScaleSetEvictionPolicy + :ivar spot_max_price: The max price (in US Dollars) you are willing to pay for spot instances. + Possible values are any decimal value greater than zero or -1 which indicates default price to + be up-to on-demand. Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: Taints added on the nodes during creation that will not be + reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl + call. This field can be modified after node pool is created, but nodes will not be recreated + with new taints until another operation that requires recreation (e.g. node image upgrade) + happens. These taints allow for required configuration to run before the node is ready to + accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl + taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable host based OS and data drive encryption. + 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: Whether to use a FIPS-enabled OS. 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.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.models.CreationData + :ivar capacity_reservation_group_id: The fully qualified resource ID of the Capacity + Reservation Group to provide virtual machines from a reserved group of Virtual Machines. This + is of the form: + '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + Customers use it to create an agentpool with a specified CRG. For more information see + `Capacity Reservation + `_. + :vartype capacity_reservation_group_id: str + :ivar host_group_id: The fully qualified resource ID of the Dedicated Host Group to provision + virtual machines from, used only in creation scenario and not allowed to changed once set. 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 network_profile: Network-related settings of an agent pool. + :vartype network_profile: ~azure.mgmt.containerservice.models.AgentPoolNetworkProfile + :ivar windows_profile: The Windows agent pool's specific profile. + :vartype windows_profile: ~azure.mgmt.containerservice.models.AgentPoolWindowsProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: ~azure.mgmt.containerservice.models.AgentPoolSecurityProfile + :ivar gpu_profile: GPU settings for the Agent Pool. + :vartype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile + :ivar gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field + cannot be set if agent pool mode is not Gateway. + :vartype gateway_profile: ~azure.mgmt.containerservice.models.AgentPoolGatewayProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: ~azure.mgmt.containerservice.models.VirtualMachinesProfile + :ivar virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. + :vartype virtual_machine_nodes_status: + list[~azure.mgmt.containerservice.models.VirtualMachineNodes] + :ivar status: Contains read-only information about the Agent Pool. + :vartype status: ~azure.mgmt.containerservice.models.AgentPoolStatus + :ivar local_dns_profile: Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. + LocalDNS helps improve performance and reliability of DNS resolution in an AKS cluster. For + more details see aka.ms/aks/localdns. + :vartype local_dns_profile: ~azure.mgmt.containerservice.models.LocalDNSProfile + :ivar node_customization_profile: Settings to determine the node customization used to + provision nodes in a pool. + :vartype node_customization_profile: + ~azure.mgmt.containerservice.models.NodeCustomizationProfile + """ + + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """Unique read-only string used to implement optimistic concurrency. The eTag value will change + when the resource is updated. Specify an if-match or if-none-match header with the eTag value + for a subsequent request to enable optimistic concurrency per the normal eTag convention.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.""" + vm_size: Optional[str] = rest_field(name="vmSize", visibility=["read", "create", "update", "delete", "query"]) + """The size of the agent pool VMs. 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 + `_.""" + os_disk_size_gb: Optional[int] = rest_field( + name="osDiskSizeGB", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = rest_field( + name="osDiskType", visibility=["read", "create", "update", "delete", "query"] + ) + """The OS disk type to be used for machines in the agent pool. 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\".""" + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = rest_field( + name="kubeletDiskType", visibility=["read", "create", "update", "delete", "query"] + ) + """Determines the placement of emptyDir volumes, container runtime data root, and Kubelet + ephemeral storage. Known values are: \"OS\" and \"Temporary\".""" + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = rest_field( + name="workloadRuntime", visibility=["read", "create", "update", "delete", "query"] + ) + """Determines the type of workload a node can run. Known values are: \"OCIContainer\", + \"WasmWasi\", \"KataMshvVmIsolation\", and \"KataVmIsolation\".""" + message_of_the_day: Optional[str] = rest_field( + name="messageOfTheDay", visibility=["read", "create", "update", "delete", "query"] + ) + """Message of the day for Linux nodes, base64-encoded. 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).""" + vnet_subnet_id: Optional[str] = rest_field( + name="vnetSubnetID", visibility=["read", "create", "update", "delete", "query"] + ) + """The ID of the subnet which agent pool nodes and optionally pods will join on startup. 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}.""" + pod_subnet_id: Optional[str] = rest_field( + name="podSubnetID", visibility=["read", "create", "update", "delete", "query"] + ) + """The ID of the subnet which pods will join when launched. 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}.""" + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = rest_field( + name="podIPAllocationMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Pod IP Allocation Mode. The IP allocation mode for pods in the agent pool. Must be used with + podSubnetId. The default is 'DynamicIndividual'. Known values are: \"DynamicIndividual\" and + \"StaticBlock\".""" + max_pods: Optional[int] = rest_field(name="maxPods", visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of pods that can run on a node.""" + os_type: Optional[Union[str, "_models.OSType"]] = rest_field( + name="osType", visibility=["read", "create", "update", "delete", "query"] + ) + """The operating system type. The default is Linux. Known values are: \"Linux\" and \"Windows\".""" + os_sku: Optional[Union[str, "_models.OSSKU"]] = rest_field( + name="osSKU", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The + default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType + is Windows. Known values are: \"Ubuntu\", \"AzureLinux\", \"AzureLinux3\", \"Mariner\", + \"Flatcar\", \"CBLMariner\", \"Windows2019\", \"Windows2022\", \"Ubuntu2204\", \"Windows2025\", + \"WindowsAnnual\", and \"Ubuntu2404\".""" + max_count: Optional[int] = rest_field(name="maxCount", visibility=["read", "create", "update", "delete", "query"]) + """The maximum number of nodes for auto-scaling.""" + min_count: Optional[int] = rest_field(name="minCount", visibility=["read", "create", "update", "delete", "query"]) + """The minimum number of nodes for auto-scaling.""" + enable_auto_scaling: Optional[bool] = rest_field( + name="enableAutoScaling", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to enable auto-scaler.""" + scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = rest_field( + name="scaleDownMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The scale down mode to use when scaling the Agent Pool. This also effects the cluster + autoscaler behavior. If not specified, it defaults to Delete. Known values are: \"Delete\" and + \"Deallocate\".""" + type: Optional[Union[str, "_models.AgentPoolType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of Agent Pool. Known values are: \"VirtualMachineScaleSets\", \"AvailabilitySet\", and + \"VirtualMachines\".""" + mode: Optional[Union[str, "_models.AgentPoolMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at all times. + For additional information on agent pool restrictions and best practices, see: + `https://docs.microsoft.com/azure/aks/use-system-pools + `_. Known values are: \"System\", + \"User\", \"Gateway\", \"ManagedSystem\", and \"Machines\".""" + orchestrator_version: Optional[str] = rest_field( + name="orchestratorVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The version of Kubernetes specified by the user. Both patch version (e.g. + 1.20.13) and (e.g. 1.20) are supported. When is specified, the + latest supported GA patch version is chosen automatically. Updating the cluster with the same + once it has been created (e.g. 1.14.x -> 1.14) 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 + `_.""" + current_orchestrator_version: Optional[str] = rest_field(name="currentOrchestratorVersion", visibility=["read"]) + """The version of Kubernetes the Agent Pool is running. If orchestratorVersion is a fully + specified version , this field will be exactly equal to it. If + orchestratorVersion is , this field will contain the full + version being used.""" + node_image_version: Optional[str] = rest_field(name="nodeImageVersion", visibility=["read"]) + """The version of node image.""" + upgrade_strategy: Optional[Union[str, "_models.UpgradeStrategy"]] = rest_field( + name="upgradeStrategy", visibility=["read", "create", "update", "delete", "query"] + ) + """Defines the upgrade strategy for the agent pool. The default is Rolling. Known values are: + \"Rolling\" and \"BlueGreen\".""" + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = rest_field( + name="upgradeSettings", visibility=["read", "create", "update", "delete", "query"] + ) + """Settings for upgrading the agentpool.""" + upgrade_settings_blue_green: Optional["_models.AgentPoolBlueGreenUpgradeSettings"] = rest_field( + name="upgradeSettingsBlueGreen", visibility=["read", "create", "update", "delete", "query"] + ) + """Settings for Blue-Green upgrade on the agentpool. Applies when upgrade strategy is set to + BlueGreen.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The current deployment or provisioning state.""" + power_state: Optional["_models.PowerState"] = rest_field( + name="powerState", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the Agent Pool is running or stopped. 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.""" + availability_zones: Optional[list[str]] = rest_field( + name="availabilityZones", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of Availability zones to use for nodes. This can only be specified if the + AgentPoolType property is 'VirtualMachineScaleSets'.""" + enable_node_public_ip: Optional[bool] = rest_field( + name="enableNodePublicIP", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether each node is allocated its own 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.""" + node_public_ip_prefix_id: Optional[str] = rest_field( + name="nodePublicIPPrefixID", visibility=["read", "create", "update", "delete", "query"] + ) + """The public IP prefix ID which VM nodes should use IPs from. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}.""" + scale_set_priority: Optional[Union[str, "_models.ScaleSetPriority"]] = rest_field( + name="scaleSetPriority", visibility=["read", "create", "update", "delete", "query"] + ) + """The Virtual Machine Scale Set priority. Known values are: \"Spot\" and \"Regular\".""" + scale_set_eviction_policy: Optional[Union[str, "_models.ScaleSetEvictionPolicy"]] = rest_field( + name="scaleSetEvictionPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """The Virtual Machine Scale Set eviction policy. 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 `_. Known values are: + \"Delete\" and \"Deallocate\".""" + spot_max_price: Optional[float] = rest_field( + name="spotMaxPrice", visibility=["read", "create", "update", "delete", "query"] + ) + """The max price (in US Dollars) you are willing to pay for spot instances. Possible values are + any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + 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 + `_.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tags to be persisted on the agent pool virtual machine scale set.""" + node_labels: Optional[dict[str, str]] = rest_field( + name="nodeLabels", visibility=["read", "create", "update", "delete", "query"] + ) + """The node labels to be persisted across all nodes in agent pool.""" + node_taints: Optional[list[str]] = rest_field( + name="nodeTaints", visibility=["read", "create", "update", "delete", "query"] + ) + """The taints added to new nodes during node pool create and scale. For example, + key=value:NoSchedule.""" + node_initialization_taints: Optional[list[str]] = rest_field( + name="nodeInitializationTaints", visibility=["read", "create", "update", "delete", "query"] + ) + """Taints added on the nodes during creation that will not be reconciled by AKS. These taints will + not be reconciled by AKS and can be removed with a kubectl call. This field can be modified + after node pool is created, but nodes will not be recreated with new taints until another + operation that requires recreation (e.g. node image upgrade) happens. These taints allow for + required configuration to run before the node is ready to accept workloads, for example + 'key1=value1:NoSchedule' that then can be removed with ``kubectl taint nodes node1 + key1=value1:NoSchedule-``.""" + proximity_placement_group_id: Optional[str] = rest_field( + name="proximityPlacementGroupID", visibility=["read", "create", "update", "delete", "query"] + ) + """The ID for Proximity Placement Group.""" + kubelet_config: Optional["_models.KubeletConfig"] = rest_field( + name="kubeletConfig", visibility=["read", "create", "update", "delete", "query"] + ) + """The Kubelet configuration on the agent pool nodes.""" + linux_os_config: Optional["_models.LinuxOSConfig"] = rest_field( + name="linuxOSConfig", visibility=["read", "create", "update", "delete", "query"] + ) + """The OS configuration of Linux agent nodes.""" + enable_encryption_at_host: Optional[bool] = rest_field( + name="enableEncryptionAtHost", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to enable host based OS and data drive encryption. 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 + `_.""" + enable_ultra_ssd: Optional[bool] = rest_field( + name="enableUltraSSD", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to enable UltraSSD.""" + enable_fips: Optional[bool] = rest_field( + name="enableFIPS", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to use a FIPS-enabled OS. See `Add a FIPS-enabled node pool + `_ + for more details.""" + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = rest_field( + name="gpuInstanceProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. + Known values are: \"MIG1g\", \"MIG2g\", \"MIG3g\", \"MIG4g\", and \"MIG7g\".""" + creation_data: Optional["_models.CreationData"] = rest_field( + name="creationData", visibility=["read", "create", "update", "delete", "query"] + ) + """CreationData to be used to specify the source Snapshot ID if the node pool will be + created/upgraded using a snapshot.""" + capacity_reservation_group_id: Optional[str] = rest_field( + name="capacityReservationGroupID", visibility=["read", "create", "update", "delete", "query"] + ) + """The fully qualified resource ID of the Capacity Reservation Group to provide virtual machines + from a reserved group of Virtual Machines. This is of the form: + '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + Customers use it to create an agentpool with a specified CRG. For more information see + `Capacity Reservation + `_.""" + host_group_id: Optional[str] = rest_field( + name="hostGroupID", visibility=["read", "create", "update", "delete", "query"] + ) + """The fully qualified resource ID of the Dedicated Host Group to provision virtual machines from, + used only in creation scenario and not allowed to changed once set. This is of the form: + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. + For more information see `Azure dedicated hosts + `_.""" + network_profile: Optional["_models.AgentPoolNetworkProfile"] = rest_field( + name="networkProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Network-related settings of an agent pool.""" + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = rest_field( + name="windowsProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The Windows agent pool's specific profile.""" + security_profile: Optional["_models.AgentPoolSecurityProfile"] = rest_field( + name="securityProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The security settings of an agent pool.""" + gpu_profile: Optional["_models.GPUProfile"] = rest_field( + name="gpuProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """GPU settings for the Agent Pool.""" + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = rest_field( + name="gatewayProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Profile specific to a managed agent pool in Gateway mode. This field cannot be set if agent + pool mode is not Gateway.""" + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = rest_field( + name="artifactStreamingProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for using artifact streaming on AKS.""" + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = rest_field( + name="virtualMachinesProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifications on VirtualMachines agent pool.""" + virtual_machine_nodes_status: Optional[list["_models.VirtualMachineNodes"]] = rest_field( + name="virtualMachineNodesStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """The status of nodes in a VirtualMachines agent pool.""" + status: Optional["_models.AgentPoolStatus"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Contains read-only information about the Agent Pool.""" + local_dns_profile: Optional["_models.LocalDNSProfile"] = rest_field( + name="localDNSProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS helps improve + performance and reliability of DNS resolution in an AKS cluster. For more details see + aka.ms/aks/localdns.""" + node_customization_profile: Optional["_models.NodeCustomizationProfile"] = rest_field( + name="nodeCustomizationProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Settings to determine the node customization used to provision nodes in a pool.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "_models.OSType"]] = None, + 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_strategy: Optional[Union[str, "_models.UpgradeStrategy"]] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + upgrade_settings_blue_green: Optional["_models.AgentPoolBlueGreenUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[list[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "_models.ScaleSetPriority"]] = None, + scale_set_eviction_policy: Optional[Union[str, "_models.ScaleSetEvictionPolicy"]] = None, + spot_max_price: Optional[float] = None, + tags: Optional[dict[str, str]] = None, + node_labels: Optional[dict[str, str]] = None, + node_taints: Optional[list[str]] = None, + node_initialization_taints: Optional[list[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.GPUProfile"] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[list["_models.VirtualMachineNodes"]] = None, + status: Optional["_models.AgentPoolStatus"] = None, + local_dns_profile: Optional["_models.LocalDNSProfile"] = None, + node_customization_profile: Optional["_models.NodeCustomizationProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): + """Profile for the container service agent pool. + + :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value + will change when the resource is updated. Specify an if-match or if-none-match header with the + eTag value for a subsequent request to enable optimistic concurrency per the normal eTag + convention. + :vartype e_tag: str + :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the + range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for + system pools. The default value is 1. + :vartype count: int + :ivar vm_size: The size of the agent pool VMs. 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 OS disk type to be used for machines in the agent pool. 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.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.models.KubeletDiskType + :ivar workload_runtime: Determines the type of workload a node can run. Known values are: + "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". + :vartype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime + :ivar message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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: The ID of the subnet which agent pool nodes and optionally pods will join + on startup. 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: The ID of the subnet which pods will join when launched. 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 pod_ip_allocation_mode: Pod IP Allocation Mode. The IP allocation mode for pods in the + agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values + are: "DynamicIndividual" and "StaticBlock". + :vartype pod_ip_allocation_mode: str or ~azure.mgmt.containerservice.models.PodIPAllocationMode + :ivar max_pods: The maximum number of pods that can run on a node. + :vartype max_pods: int + :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and + "Windows". + :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType + :ivar os_sku: Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is + Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= + 1.25 if OSType is Windows. Known values are: "Ubuntu", "AzureLinux", "AzureLinux3", "Mariner", + "Flatcar", "CBLMariner", "Windows2019", "Windows2022", "Ubuntu2204", "Windows2025", + "WindowsAnnual", and "Ubuntu2404". + :vartype os_sku: str or ~azure.mgmt.containerservice.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: The scale down mode to use when scaling the Agent Pool. 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.models.ScaleDownMode + :ivar type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", + "AvailabilitySet", and "VirtualMachines". + :vartype type: str or ~azure.mgmt.containerservice.models.AgentPoolType + :ivar mode: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at + all times. For additional information on agent pool restrictions and best practices, see: + `https://docs.microsoft.com/azure/aks/use-system-pools + `_. Known values are: "System", "User", + "Gateway", "ManagedSystem", and "Machines". + :vartype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode + :ivar orchestrator_version: The version of Kubernetes specified by the user. Both patch version + (e.g. 1.20.13) and (e.g. 1.20) are supported. When + is specified, the latest supported GA patch version is chosen automatically. + Updating the cluster with the same once it has been created (e.g. 1.14.x -> 1.14) + 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: The version of Kubernetes the Agent Pool is running. If + orchestratorVersion is a fully specified version , this field will be + exactly equal to it. If orchestratorVersion is , 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_strategy: Defines the upgrade strategy for the agent pool. The default is + Rolling. Known values are: "Rolling" and "BlueGreen". + :vartype upgrade_strategy: str or ~azure.mgmt.containerservice.models.UpgradeStrategy + :ivar upgrade_settings: Settings for upgrading the agentpool. + :vartype upgrade_settings: ~azure.mgmt.containerservice.models.AgentPoolUpgradeSettings + :ivar upgrade_settings_blue_green: Settings for Blue-Green upgrade on the agentpool. Applies + when upgrade strategy is set to BlueGreen. + :vartype upgrade_settings_blue_green: + ~azure.mgmt.containerservice.models.AgentPoolBlueGreenUpgradeSettings + :ivar provisioning_state: The current deployment or provisioning state. + :vartype provisioning_state: str + :ivar power_state: Whether the Agent Pool is running or stopped. 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.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: Whether each node is allocated its own 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 node_public_ip_prefix_id: The public IP prefix ID which VM nodes should use IPs from. + 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. Known values are: "Spot" and + "Regular". + :vartype scale_set_priority: str or ~azure.mgmt.containerservice.models.ScaleSetPriority + :ivar scale_set_eviction_policy: The Virtual Machine Scale Set eviction policy. 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 + `_. Known values are: "Delete" and + "Deallocate". + :vartype scale_set_eviction_policy: str or + ~azure.mgmt.containerservice.models.ScaleSetEvictionPolicy + :ivar spot_max_price: The max price (in US Dollars) you are willing to pay for spot instances. + Possible values are any decimal value greater than zero or -1 which indicates default price to + be up-to on-demand. Possible values are any decimal value greater than zero or -1 which + indicates the willingness to pay any on-demand price. For more details on spot pricing, see + `spot VMs pricing `_. + :vartype spot_max_price: float + :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. + :vartype tags: dict[str, str] + :ivar node_labels: The node labels to be persisted across all nodes in agent pool. + :vartype node_labels: dict[str, str] + :ivar node_taints: The taints added to new nodes during node pool create and scale. For + example, key=value:NoSchedule. + :vartype node_taints: list[str] + :ivar node_initialization_taints: Taints added on the nodes during creation that will not be + reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl + call. This field can be modified after node pool is created, but nodes will not be recreated + with new taints until another operation that requires recreation (e.g. node image upgrade) + happens. These taints allow for required configuration to run before the node is ready to + accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl + taint nodes node1 key1=value1:NoSchedule-``. + :vartype node_initialization_taints: list[str] + :ivar proximity_placement_group_id: The ID for Proximity Placement Group. + :vartype proximity_placement_group_id: str + :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. + :vartype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig + :ivar linux_os_config: The OS configuration of Linux agent nodes. + :vartype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig + :ivar enable_encryption_at_host: Whether to enable host based OS and data drive encryption. + 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: Whether to use a FIPS-enabled OS. 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.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.models.CreationData + :ivar capacity_reservation_group_id: The fully qualified resource ID of the Capacity + Reservation Group to provide virtual machines from a reserved group of Virtual Machines. This + is of the form: + '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/capacityreservationgroups/{capacityReservationGroupName}' + Customers use it to create an agentpool with a specified CRG. For more information see + `Capacity Reservation + `_. + :vartype capacity_reservation_group_id: str + :ivar host_group_id: The fully qualified resource ID of the Dedicated Host Group to provision + virtual machines from, used only in creation scenario and not allowed to changed once set. 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 network_profile: Network-related settings of an agent pool. + :vartype network_profile: ~azure.mgmt.containerservice.models.AgentPoolNetworkProfile + :ivar windows_profile: The Windows agent pool's specific profile. + :vartype windows_profile: ~azure.mgmt.containerservice.models.AgentPoolWindowsProfile + :ivar security_profile: The security settings of an agent pool. + :vartype security_profile: ~azure.mgmt.containerservice.models.AgentPoolSecurityProfile + :ivar gpu_profile: GPU settings for the Agent Pool. + :vartype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile + :ivar gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field + cannot be set if agent pool mode is not Gateway. + :vartype gateway_profile: ~azure.mgmt.containerservice.models.AgentPoolGatewayProfile + :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. + :vartype artifact_streaming_profile: + ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile + :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. + :vartype virtual_machines_profile: ~azure.mgmt.containerservice.models.VirtualMachinesProfile + :ivar virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. + :vartype virtual_machine_nodes_status: + list[~azure.mgmt.containerservice.models.VirtualMachineNodes] + :ivar status: Contains read-only information about the Agent Pool. + :vartype status: ~azure.mgmt.containerservice.models.AgentPoolStatus + :ivar local_dns_profile: Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. + LocalDNS helps improve performance and reliability of DNS resolution in an AKS cluster. For + more details see aka.ms/aks/localdns. + :vartype local_dns_profile: ~azure.mgmt.containerservice.models.LocalDNSProfile + :ivar node_customization_profile: Settings to determine the node customization used to + provision nodes in a pool. + :vartype node_customization_profile: + ~azure.mgmt.containerservice.models.NodeCustomizationProfile + :ivar name: Unique name of the agent pool profile in the context of the subscription and + resource group. Windows agent pool names must be 6 characters or less. Required. + :vartype name: str + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Unique name of the agent pool profile in the context of the subscription and resource group. + Windows agent pool names must be 6 characters or less. Required.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + name: str, + count: Optional[int] = None, + vm_size: Optional[str] = None, + os_disk_size_gb: Optional[int] = None, + os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, + kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, + workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, + message_of_the_day: Optional[str] = None, + vnet_subnet_id: Optional[str] = None, + pod_subnet_id: Optional[str] = None, + pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, + max_pods: Optional[int] = None, + os_type: Optional[Union[str, "_models.OSType"]] = None, + 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_strategy: Optional[Union[str, "_models.UpgradeStrategy"]] = None, + upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, + upgrade_settings_blue_green: Optional["_models.AgentPoolBlueGreenUpgradeSettings"] = None, + power_state: Optional["_models.PowerState"] = None, + availability_zones: Optional[list[str]] = None, + enable_node_public_ip: Optional[bool] = None, + node_public_ip_prefix_id: Optional[str] = None, + scale_set_priority: Optional[Union[str, "_models.ScaleSetPriority"]] = None, + scale_set_eviction_policy: Optional[Union[str, "_models.ScaleSetEvictionPolicy"]] = None, + spot_max_price: Optional[float] = None, + tags: Optional[dict[str, str]] = None, + node_labels: Optional[dict[str, str]] = None, + node_taints: Optional[list[str]] = None, + node_initialization_taints: Optional[list[str]] = None, + proximity_placement_group_id: Optional[str] = None, + kubelet_config: Optional["_models.KubeletConfig"] = None, + linux_os_config: Optional["_models.LinuxOSConfig"] = None, + enable_encryption_at_host: Optional[bool] = None, + enable_ultra_ssd: Optional[bool] = None, + enable_fips: Optional[bool] = None, + gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, + creation_data: Optional["_models.CreationData"] = None, + capacity_reservation_group_id: Optional[str] = None, + host_group_id: Optional[str] = None, + network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, + windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, + security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, + gpu_profile: Optional["_models.GPUProfile"] = None, + gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, + artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, + virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, + virtual_machine_nodes_status: Optional[list["_models.VirtualMachineNodes"]] = None, + status: Optional["_models.AgentPoolStatus"] = None, + local_dns_profile: Optional["_models.LocalDNSProfile"] = None, + node_customization_profile: Optional["_models.NodeCustomizationProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAIToolchainOperatorProfile(_Model): + """When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the + cluster. The operator automates the deployment of OSS models for inference and/or training + purposes. It provides a set of preset models and enables distributed inference against them. + + :ivar enabled: Whether to enable AI toolchain operator to the cluster. Indicates if AI + toolchain operator enabled or not. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable AI toolchain operator to the cluster. Indicates if AI toolchain operator + enabled or not.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAPIServerAccessProfile(_Model): + """Access profile for managed cluster API server. + + :ivar authorized_ip_ranges: The IP ranges authorized to access the Kubernetes API server. 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: Whether to create the cluster as a private cluster or not. For + more details, see `Creating a private AKS cluster + `_. + :vartype enable_private_cluster: bool + :ivar private_dns_zone: The private DNS zone mode for the cluster. 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. See aka.ms/AksVnetIntegration for more details. + :vartype enable_vnet_integration: bool + :ivar subnet_id: The subnet to be used when apiserver vnet integration is enabled. It is + required when creating a new cluster with BYO Vnet, or when updating an existing cluster to + enable apiserver vnet integration. + :vartype subnet_id: str + """ + + authorized_ip_ranges: Optional[list[str]] = rest_field( + name="authorizedIPRanges", visibility=["read", "create", "update", "delete", "query"] + ) + """The IP ranges authorized to access the Kubernetes API server. 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 + `_.""" + enable_private_cluster: Optional[bool] = rest_field( + name="enablePrivateCluster", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to create the cluster as a private cluster or not. For more details, see `Creating a + private AKS cluster `_.""" + private_dns_zone: Optional[str] = rest_field( + name="privateDNSZone", visibility=["read", "create", "update", "delete", "query"] + ) + """The private DNS zone mode for the cluster. The default is System. For more details see + `configure private DNS zone + `_. Allowed + values are 'system' and 'none'.""" + enable_private_cluster_public_fqdn: Optional[bool] = rest_field( + name="enablePrivateClusterPublicFQDN", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to create additional public FQDN for private cluster or not.""" + disable_run_command: Optional[bool] = rest_field( + name="disableRunCommand", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to disable run command for the cluster or not.""" + enable_vnet_integration: Optional[bool] = rest_field( + name="enableVnetIntegration", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to enable apiserver vnet integration for the cluster or not. See + aka.ms/AksVnetIntegration for more details.""" + subnet_id: Optional[str] = rest_field(name="subnetId", visibility=["read", "create", "update", "delete", "query"]) + """The subnet to be used when apiserver vnet integration is enabled. It is required when creating + a new cluster with BYO Vnet, or when updating an existing cluster to enable apiserver vnet + integration.""" + + @overload + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAutoUpgradeProfile(_Model): + """Auto upgrade profile for a managed cluster. + + :ivar upgrade_channel: The upgrade channel for auto upgrade. The default is 'none'. 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.models.UpgradeChannel + :ivar node_os_upgrade_channel: Node OS Upgrade Channel. Manner in which the OS on your nodes is + updated. The default is NodeImage. Known values are: "None", "Unmanaged", "NodeImage", and + "SecurityPatch". + :vartype node_os_upgrade_channel: str or + ~azure.mgmt.containerservice.models.NodeOSUpgradeChannel + """ + + upgrade_channel: Optional[Union[str, "_models.UpgradeChannel"]] = rest_field( + name="upgradeChannel", visibility=["read", "create", "update", "delete", "query"] + ) + """The upgrade channel for auto upgrade. The default is 'none'. For more information see `setting + the AKS cluster auto-upgrade channel + `_. Known values + are: \"rapid\", \"stable\", \"patch\", \"node-image\", and \"none\".""" + node_os_upgrade_channel: Optional[Union[str, "_models.NodeOSUpgradeChannel"]] = rest_field( + name="nodeOSUpgradeChannel", visibility=["read", "create", "update", "delete", "query"] + ) + """Node OS Upgrade Channel. Manner in which the OS on your nodes is updated. The default is + NodeImage. Known values are: \"None\", \"Unmanaged\", \"NodeImage\", and \"SecurityPatch\".""" + + @overload + def __init__( + self, + *, + upgrade_channel: Optional[Union[str, "_models.UpgradeChannel"]] = None, + node_os_upgrade_channel: Optional[Union[str, "_models.NodeOSUpgradeChannel"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAzureMonitorProfile(_Model): + """Azure Monitor addon profiles for monitoring the managed cluster. + + :ivar metrics: Metrics profile for the Azure Monitor managed service for Prometheus addon. + Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace + and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an + overview. + :vartype metrics: ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileMetrics + :ivar container_insights: Azure Monitor Container Insights Profile for Kubernetes Events, + Inventory and Container stdout & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for + an overview. + :vartype container_insights: + ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileContainerInsights + :ivar app_monitoring: Application Monitoring Profile for Kubernetes Application Container. + Collects application logs, metrics and traces through auto-instrumentation of the application + using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for + an overview. + :vartype app_monitoring: + ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoring + """ + + metrics: Optional["_models.ManagedClusterAzureMonitorProfileMetrics"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect + out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and + configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an + overview.""" + container_insights: Optional["_models.ManagedClusterAzureMonitorProfileContainerInsights"] = rest_field( + name="containerInsights", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout + & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for an overview.""" + app_monitoring: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoring"] = rest_field( + name="appMonitoring", visibility=["read", "create", "update", "delete", "query"] + ) + """Application Monitoring Profile for Kubernetes Application Container. Collects application logs, + metrics and traces through auto-instrumentation of the application using Azure Monitor + OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview.""" + + @overload + def __init__( + self, + *, + metrics: Optional["_models.ManagedClusterAzureMonitorProfileMetrics"] = None, + container_insights: Optional["_models.ManagedClusterAzureMonitorProfileContainerInsights"] = None, + app_monitoring: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoring"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAzureMonitorProfileAppMonitoring(_Model): # pylint: disable=name-too-long + """Application Monitoring Profile for Kubernetes Application Container. Collects application logs, + metrics and traces through auto-instrumentation of the application using Azure Monitor + OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. + + :ivar auto_instrumentation: Application Monitoring Auto Instrumentation for Kubernetes + Application Container. Deploys web hook to auto-instrument Azure Monitor OpenTelemetry based + SDKs to collect OpenTelemetry metrics, logs and traces of the application. See + aka.ms/AzureMonitorApplicationMonitoring for an overview. + :vartype auto_instrumentation: + ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation + :ivar open_telemetry_metrics: Application Monitoring Open Telemetry Metrics Profile for + Kubernetes Application Container Metrics. Collects OpenTelemetry metrics of the application + using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for + an overview. + :vartype open_telemetry_metrics: + ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics + :ivar open_telemetry_logs: Application Monitoring Open Telemetry Metrics Profile for Kubernetes + Application Container Logs and Traces. Collects OpenTelemetry logs and traces of the + application using Azure Monitor OpenTelemetry based SDKs. See + aka.ms/AzureMonitorApplicationMonitoring for an overview. + :vartype open_telemetry_logs: + ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs + """ + + auto_instrumentation: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation"] = ( + rest_field(name="autoInstrumentation", visibility=["read", "create", "update", "delete", "query"]) + ) + """Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web + hook to auto-instrument Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry + metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring for + an overview.""" + open_telemetry_metrics: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics"] = ( + rest_field(name="openTelemetryMetrics", visibility=["read", "create", "update", "delete", "query"]) + ) + """Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container + Metrics. Collects OpenTelemetry metrics of the application using Azure Monitor OpenTelemetry + based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview.""" + open_telemetry_logs: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs"] = ( + rest_field(name="openTelemetryLogs", visibility=["read", "create", "update", "delete", "query"]) + ) + """Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs + and Traces. Collects OpenTelemetry logs and traces of the application using Azure Monitor + OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview.""" + + @overload + def __init__( + self, + *, + auto_instrumentation: Optional[ + "_models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation" + ] = None, + open_telemetry_metrics: Optional[ + "_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics" + ] = None, + open_telemetry_logs: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation(_Model): # pylint: disable=name-too-long + """Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web + hook to auto-instrument Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry + metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring for + an overview. + + :ivar enabled: Indicates if Application Monitoring Auto Instrumentation is enabled or not. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if Application Monitoring Auto Instrumentation is enabled or not.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs(_Model): # pylint: disable=name-too-long + """Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs + and Traces. Collects OpenTelemetry logs and traces of the application using Azure Monitor + OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. + + :ivar enabled: Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or + not. + :vartype enabled: bool + :ivar port: The Open Telemetry host port for Open Telemetry logs and traces. If not specified, + the default port is 28331. + :vartype port: int + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or not.""" + port: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Open Telemetry host port for Open Telemetry logs and traces. If not specified, the default + port is 28331.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + port: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics(_Model): # pylint: disable=name-too-long + """Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container + Metrics. Collects OpenTelemetry metrics of the application using Azure Monitor OpenTelemetry + based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. + + :ivar enabled: Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. + :vartype enabled: bool + :ivar port: The Open Telemetry host port for Open Telemetry metrics. If not specified, the + default port is 28333. + :vartype port: int + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if Application Monitoring Open Telemetry Metrics is enabled or not.""" + port: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Open Telemetry host port for Open Telemetry metrics. If not specified, the default port is + 28333.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + port: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAzureMonitorProfileContainerInsights(_Model): # pylint: disable=name-too-long + """Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout + & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for an overview. + + :ivar enabled: Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. + :vartype enabled: bool + :ivar log_analytics_workspace_resource_id: Fully Qualified ARM Resource Id of Azure Log + Analytics Workspace for storing Azure Monitor Container Insights Logs. + :vartype log_analytics_workspace_resource_id: str + :ivar syslog_port: The syslog host port. If not specified, the default port is 28330. + :vartype syslog_port: int + :ivar disable_custom_metrics: Indicates whether custom metrics collection has to be disabled or + not. If not specified the default is false. No custom metrics will be emitted if this field is + false but the container insights enabled field is false. + :vartype disable_custom_metrics: bool + :ivar disable_prometheus_metrics_scraping: Indicates whether prometheus metrics scraping is + disabled or not. If not specified the default is false. No prometheus metrics will be emitted + if this field is false but the container insights enabled field is false. + :vartype disable_prometheus_metrics_scraping: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Indicates if Azure Monitor Container Insights Logs Addon is enabled or not.""" + log_analytics_workspace_resource_id: Optional[str] = rest_field( + name="logAnalyticsWorkspaceResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Fully Qualified ARM Resource Id of Azure Log Analytics Workspace for storing Azure Monitor + Container Insights Logs.""" + syslog_port: Optional[int] = rest_field( + name="syslogPort", visibility=["read", "create", "update", "delete", "query"] + ) + """The syslog host port. If not specified, the default port is 28330.""" + disable_custom_metrics: Optional[bool] = rest_field( + name="disableCustomMetrics", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether custom metrics collection has to be disabled or not. If not specified the + default is false. No custom metrics will be emitted if this field is false but the container + insights enabled field is false.""" + disable_prometheus_metrics_scraping: Optional[bool] = rest_field( + name="disablePrometheusMetricsScraping", visibility=["read", "create", "update", "delete", "query"] + ) + """Indicates whether prometheus metrics scraping is disabled or not. If not specified the default + is false. No prometheus metrics will be emitted if this field is false but the container + insights enabled field is false.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + log_analytics_workspace_resource_id: Optional[str] = None, + syslog_port: Optional[int] = None, + disable_custom_metrics: Optional[bool] = None, + disable_prometheus_metrics_scraping: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAzureMonitorProfileKubeStateMetrics(_Model): # pylint: disable=name-too-long + """Kube State Metrics profile for the Azure Managed Prometheus addon. These optional settings are + for the kube-state-metrics pod that is deployed with the addon. See + aka.ms/AzureManagedPrometheus-optional-parameters for details. + + :ivar metric_labels_allowlist: Comma-separated list of additional Kubernetes label keys that + will be used in the resource's labels metric (Example: + 'namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...'). By default the metric contains only + resource name and namespace labels. + :vartype metric_labels_allowlist: str + :ivar metric_annotations_allow_list: Comma-separated list of Kubernetes annotation keys that + will be used in the resource's labels metric (Example: + 'namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...'). By default the metric + contains only resource name and namespace labels. + :vartype metric_annotations_allow_list: str + """ + + metric_labels_allowlist: Optional[str] = rest_field( + name="metricLabelsAllowlist", visibility=["read", "create", "update", "delete", "query"] + ) + """Comma-separated list of additional Kubernetes label keys that will be used in the resource's + labels metric (Example: 'namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...'). By default + the metric contains only resource name and namespace labels.""" + metric_annotations_allow_list: Optional[str] = rest_field( + name="metricAnnotationsAllowList", visibility=["read", "create", "update", "delete", "query"] + ) + """Comma-separated list of Kubernetes annotation keys that will be used in the resource's labels + metric (Example: 'namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...'). By + default the metric contains only resource name and namespace labels.""" + + @overload + def __init__( + self, + *, + metric_labels_allowlist: Optional[str] = None, + metric_annotations_allow_list: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterAzureMonitorProfileMetrics(_Model): + """Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect + out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and + configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an + overview. + + :ivar enabled: Whether to enable or disable the Azure Managed Prometheus addon for Prometheus + monitoring. See aka.ms/AzureManagedPrometheus-aks-enable for details on enabling and disabling. + Required. + :vartype enabled: bool + :ivar kube_state_metrics: Kube State Metrics profile for the Azure Managed Prometheus addon. + These optional settings are for the kube-state-metrics pod that is deployed with the addon. See + aka.ms/AzureManagedPrometheus-optional-parameters for details. + :vartype kube_state_metrics: + ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileKubeStateMetrics + """ + + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable or disable the Azure Managed Prometheus addon for Prometheus monitoring. See + aka.ms/AzureManagedPrometheus-aks-enable for details on enabling and disabling. Required.""" + kube_state_metrics: Optional["_models.ManagedClusterAzureMonitorProfileKubeStateMetrics"] = rest_field( + name="kubeStateMetrics", visibility=["read", "create", "update", "delete", "query"] + ) + """Kube State Metrics profile for the Azure Managed Prometheus addon. These optional settings are + for the kube-state-metrics pod that is deployed with the addon. See + aka.ms/AzureManagedPrometheus-optional-parameters for details.""" + + @overload + def __init__( + self, + *, + enabled: bool, + kube_state_metrics: Optional["_models.ManagedClusterAzureMonitorProfileKubeStateMetrics"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterBootstrapProfile(_Model): + """The bootstrap profile. + + :ivar artifact_source: The artifact source. The source where the artifacts are downloaded from. + Known values are: "Cache" and "Direct". + :vartype artifact_source: str or ~azure.mgmt.containerservice.models.ArtifactSource + :ivar container_registry_id: The resource Id of Azure Container Registry. The registry must + have private network access, premium SKU and zone redundancy. + :vartype container_registry_id: str + """ + + artifact_source: Optional[Union[str, "_models.ArtifactSource"]] = rest_field( + name="artifactSource", visibility=["read", "create", "update", "delete", "query"] + ) + """The artifact source. The source where the artifacts are downloaded from. Known values are: + \"Cache\" and \"Direct\".""" + container_registry_id: Optional[str] = rest_field( + name="containerRegistryId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource Id of Azure Container Registry. The registry must have private network access, + premium SKU and zone redundancy.""" + + @overload + def __init__( + self, + *, + artifact_source: Optional[Union[str, "_models.ArtifactSource"]] = None, + container_registry_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterCostAnalysis(_Model): + """The cost analysis configuration for the cluster. + + :ivar enabled: Whether to enable cost analysis. The Managed Cluster sku.tier must be set to + 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and + Deployment details to the Cost Analysis views in the Azure portal. If not specified, the + default is false. For more information see aka.ms/aks/docs/cost-analysis. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable cost analysis. The Managed Cluster sku.tier must be set to 'Standard' or + 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and Deployment + details to the Cost Analysis views in the Azure portal. If not specified, the default is false. + For more information see aka.ms/aks/docs/cost-analysis.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterHostedSystemProfile(_Model): + """Settings for hosted system addons. + + :ivar enabled: Whether to enable hosted system addons for the cluster. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable hosted system addons for the cluster.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterHTTPProxyConfig(_Model): + """Cluster HTTP proxy configuration. + + :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 + :ivar enabled: Whether to enable HTTP proxy. When disabled, the specified proxy configuration + will be not be set on pods and nodes. + :vartype enabled: bool + """ + + http_proxy: Optional[str] = rest_field(name="httpProxy", visibility=["read", "create", "update", "delete", "query"]) + """The HTTP proxy server endpoint to use.""" + https_proxy: Optional[str] = rest_field( + name="httpsProxy", visibility=["read", "create", "update", "delete", "query"] + ) + """The HTTPS proxy server endpoint to use.""" + no_proxy: Optional[list[str]] = rest_field( + name="noProxy", visibility=["read", "create", "update", "delete", "query"] + ) + """The endpoints that should not go through proxy.""" + effective_no_proxy: Optional[list[str]] = rest_field(name="effectiveNoProxy", visibility=["read"]) + """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.""" + trusted_ca: Optional[str] = rest_field(name="trustedCa", visibility=["read", "create", "update", "delete", "query"]) + """Alternative CA cert to use for connecting to proxy servers.""" + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable HTTP proxy. When disabled, the specified proxy configuration will be not be + set on pods and nodes.""" + + @overload + def __init__( + self, + *, + http_proxy: Optional[str] = None, + https_proxy: Optional[str] = None, + no_proxy: Optional[list[str]] = None, + trusted_ca: Optional[str] = None, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterIdentity(_Model): + """Identity for the managed cluster. + + :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: The type of identity used for the managed cluster. For more information see `use + managed identities in AKS `_. Known + values are: "SystemAssigned", "UserAssigned", and "None". + :vartype type: str or ~azure.mgmt.containerservice.models.ResourceIdentityType + :ivar delegated_resources: The delegated identity resources assigned to this managed cluster. + This can only be set by another Azure Resource Provider, and managed cluster only accept one + delegated identity resource. Internal use only. + :vartype delegated_resources: dict[str, ~azure.mgmt.containerservice.models.DelegatedResource] + :ivar user_assigned_identities: The user identity associated with the managed cluster. This + identity will be used in control plane. Only one user assigned identity is allowed. 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.models.ManagedServiceIdentityUserAssignedIdentitiesValue] + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal id of the system assigned identity which is used by master components.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant id of the system assigned identity which is used by master components.""" + type: Optional[Union[str, "_models.ResourceIdentityType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity used for the managed cluster. For more information see `use managed + identities in AKS `_. Known values + are: \"SystemAssigned\", \"UserAssigned\", and \"None\".""" + delegated_resources: Optional[dict[str, "_models.DelegatedResource"]] = rest_field( + name="delegatedResources", visibility=["read", "create", "update", "delete", "query"] + ) + """The delegated identity resources assigned to this managed cluster. This can only be set by + another Azure Resource Provider, and managed cluster only accept one delegated identity + resource. Internal use only.""" + user_assigned_identities: Optional[dict[str, "_models.ManagedServiceIdentityUserAssignedIdentitiesValue"]] = ( + rest_field(name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"]) + ) + """The user identity associated with the managed cluster. This identity will be used in control + plane. Only one user assigned identity is allowed. The keys must be ARM resource IDs in the + form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, + delegated_resources: Optional[dict[str, "_models.DelegatedResource"]] = None, + user_assigned_identities: Optional[ + dict[str, "_models.ManagedServiceIdentityUserAssignedIdentitiesValue"] + ] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterIngressDefaultDomainProfile(_Model): # pylint: disable=name-too-long + """Default domain profile for the managed cluster ingress profile. + + :ivar enabled: Whether to enable Default Domain. + :vartype enabled: bool + :ivar domain_name: The unique fully qualified domain name assigned to the cluster. This will + not change even if disabled then reenabled. + :vartype domain_name: str + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable Default Domain.""" + domain_name: Optional[str] = rest_field(name="domainName", visibility=["read"]) + """The unique fully qualified domain name assigned to the cluster. This will not change even if + disabled then reenabled.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterIngressProfile(_Model): + """Ingress profile for the container service cluster. + + :ivar web_app_routing: App Routing settings for the ingress profile. You can find an overview + and onboarding guide for this feature at + `https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default + `_. + :vartype web_app_routing: + ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileWebAppRouting + :ivar gateway_api: Settings for the managed Gateway API installation. + :vartype gateway_api: + ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileGatewayConfiguration + :ivar application_load_balancer: Settings for the managed Application Load Balancer + installation. + :vartype application_load_balancer: + ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileApplicationLoadBalancer + """ + + web_app_routing: Optional["_models.ManagedClusterIngressProfileWebAppRouting"] = rest_field( + name="webAppRouting", visibility=["read", "create", "update", "delete", "query"] + ) + """App Routing settings for the ingress profile. You can find an overview and onboarding guide for + this feature at + `https://learn.microsoft.com/en-us/azure/aks/app-routing?tabs=default%2Cdeploy-app-default + `_.""" + gateway_api: Optional["_models.ManagedClusterIngressProfileGatewayConfiguration"] = rest_field( + name="gatewayAPI", visibility=["read", "create", "update", "delete", "query"] + ) + """Settings for the managed Gateway API installation.""" + application_load_balancer: Optional["_models.ManagedClusterIngressProfileApplicationLoadBalancer"] = rest_field( + name="applicationLoadBalancer", visibility=["read", "create", "update", "delete", "query"] + ) + """Settings for the managed Application Load Balancer installation.""" + + @overload + def __init__( + self, + *, + web_app_routing: Optional["_models.ManagedClusterIngressProfileWebAppRouting"] = None, + gateway_api: Optional["_models.ManagedClusterIngressProfileGatewayConfiguration"] = None, + application_load_balancer: Optional["_models.ManagedClusterIngressProfileApplicationLoadBalancer"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterIngressProfileApplicationLoadBalancer(_Model): # pylint: disable=name-too-long + """Application Load Balancer settings for the ingress profile. + + :ivar enabled: Whether to enable Application Load Balancer. + :vartype enabled: bool + :ivar identity: Managed identity of the Application Load Balancer add-on. This is the identity + that should be granted permissions to manage the associated Application Gateway for Containers + resource. + :vartype identity: ~azure.mgmt.containerservice.models.UserAssignedIdentity + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable Application Load Balancer.""" + identity: Optional["_models.UserAssignedIdentity"] = rest_field(visibility=["read"]) + """Managed identity of the Application Load Balancer add-on. This is the identity that should be + granted permissions to manage the associated Application Gateway for Containers resource.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterIngressProfileGatewayConfiguration(_Model): # pylint: disable=name-too-long + """Configuration for the ingress managed gateway. See `https://aka.ms/k8s-gateway-api + `_ for more details. + + :ivar installation: Configuration for the managed Gateway API installation. If not specified, + the default is 'Disabled'. See `https://aka.ms/k8s-gateway-api + `_ for more details. Known values are: "Disabled" and + "Standard". + :vartype installation: str or ~azure.mgmt.containerservice.models.ManagedGatewayType + """ + + installation: Optional[Union[str, "_models.ManagedGatewayType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the managed Gateway API installation. If not specified, the default is + 'Disabled'. See `https://aka.ms/k8s-gateway-api `_ for more + details. Known values are: \"Disabled\" and \"Standard\".""" + + @overload + def __init__( + self, + *, + installation: Optional[Union[str, "_models.ManagedGatewayType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterIngressProfileNginx(_Model): + """Nginx ingress controller configuration for the managed cluster ingress profile. + + :ivar default_ingress_controller_type: Ingress type for the default NginxIngressController + custom resource. Known values are: "AnnotationControlled", "External", "Internal", and "None". + :vartype default_ingress_controller_type: str or + ~azure.mgmt.containerservice.models.NginxIngressControllerType + """ + + default_ingress_controller_type: Optional[Union[str, "_models.NginxIngressControllerType"]] = rest_field( + name="defaultIngressControllerType", visibility=["read", "create", "update", "delete", "query"] + ) + """Ingress type for the default NginxIngressController custom resource. Known values are: + \"AnnotationControlled\", \"External\", \"Internal\", and \"None\".""" + + @overload + def __init__( + self, + *, + default_ingress_controller_type: Optional[Union[str, "_models.NginxIngressControllerType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterIngressProfileWebAppRouting(_Model): # pylint: disable=name-too-long + """Application Routing add-on settings for the ingress profile. + + :ivar enabled: Whether to enable the Application Routing add-on. + :vartype enabled: bool + :ivar dns_zone_resource_ids: Resource IDs of the DNS zones to be associated with the + Application Routing add-on. Used only when Application Routing add-on is enabled. Public and + private DNS zones can be in different resource groups, but all public DNS zones must be in the + same resource group and all private DNS zones must be in the same resource group. + :vartype dns_zone_resource_ids: list[str] + :ivar nginx: Configuration for the default NginxIngressController. See more at + `https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller + `_. + :vartype nginx: ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileNginx + :ivar identity: Managed identity of the Application Routing add-on. This is the identity that + should be granted permissions, for example, to manage the associated Azure DNS resource and get + certificates from Azure Key Vault. See `this overview of the add-on + `_ for more + instructions. + :vartype identity: ~azure.mgmt.containerservice.models.UserAssignedIdentity + :ivar default_domain: Configuration for the Default Domain. This is a unique, autogenerated + domain that comes with a signed TLS Certificate allowing for secure HTTPS. See `the Default + Domain documentation `_ for more instructions. + :vartype default_domain: + ~azure.mgmt.containerservice.models.ManagedClusterIngressDefaultDomainProfile + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable the Application Routing add-on.""" + dns_zone_resource_ids: Optional[list[str]] = rest_field( + name="dnsZoneResourceIds", visibility=["read", "create", "update", "delete", "query"] + ) + """Resource IDs of the DNS zones to be associated with the Application Routing add-on. Used only + when Application Routing add-on is enabled. Public and private DNS zones can be in different + resource groups, but all public DNS zones must be in the same resource group and all private + DNS zones must be in the same resource group.""" + nginx: Optional["_models.ManagedClusterIngressProfileNginx"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the default NginxIngressController. See more at + `https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller + `_.""" + identity: Optional["_models.UserAssignedIdentity"] = rest_field(visibility=["read"]) + """Managed identity of the Application Routing add-on. This is the identity that should be granted + permissions, for example, to manage the associated Azure DNS resource and get certificates from + Azure Key Vault. See `this overview of the add-on + `_ for more + instructions.""" + default_domain: Optional["_models.ManagedClusterIngressDefaultDomainProfile"] = rest_field( + name="defaultDomain", visibility=["read", "create", "update", "delete", "query"] + ) + """Configuration for the Default Domain. This is a unique, autogenerated domain that comes with a + signed TLS Certificate allowing for secure HTTPS. See `the Default Domain documentation + `_ for more instructions.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + dns_zone_resource_ids: Optional[list[str]] = None, + nginx: Optional["_models.ManagedClusterIngressProfileNginx"] = None, + default_domain: Optional["_models.ManagedClusterIngressDefaultDomainProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterLoadBalancerProfile(_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.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs + :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. + :vartype outbound_ip_prefixes: + ~azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes + :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. + :vartype outbound_i_ps: + ~azure.mgmt.containerservice.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.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.models.BackendPoolType + :ivar cluster_service_load_balancer_health_probe_mode: The health probing behavior for External + Traffic Policy Cluster services. Known values are: "ServiceNodePort" and "Shared". + :vartype cluster_service_load_balancer_health_probe_mode: str or + ~azure.mgmt.containerservice.models.ClusterServiceLoadBalancerHealthProbeMode + """ + + managed_outbound_i_ps: Optional["_models.ManagedClusterLoadBalancerProfileManagedOutboundIPs"] = rest_field( + name="managedOutboundIPs", visibility=["read", "create", "update", "delete", "query"] + ) + """Desired managed outbound IPs for the cluster load balancer.""" + outbound_ip_prefixes: Optional["_models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes"] = rest_field( + name="outboundIPPrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """Desired outbound IP Prefix resources for the cluster load balancer.""" + outbound_i_ps: Optional["_models.ManagedClusterLoadBalancerProfileOutboundIPs"] = rest_field( + name="outboundIPs", visibility=["read", "create", "update", "delete", "query"] + ) + """Desired outbound IP resources for the cluster load balancer.""" + effective_outbound_i_ps: Optional[list["_models.ResourceReference"]] = rest_field( + name="effectiveOutboundIPs", visibility=["read"] + ) + """The effective outbound IP resources of the cluster load balancer.""" + allocated_outbound_ports: Optional[int] = rest_field( + name="allocatedOutboundPorts", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + idle_timeout_in_minutes: Optional[int] = rest_field( + name="idleTimeoutInMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 + (inclusive). The default value is 30 minutes.""" + enable_multiple_standard_load_balancers: Optional[bool] = rest_field( + name="enableMultipleStandardLoadBalancers", visibility=["read", "create", "update", "delete", "query"] + ) + """Enable multiple standard load balancers per AKS cluster or not.""" + backend_pool_type: Optional[Union[str, "_models.BackendPoolType"]] = rest_field( + name="backendPoolType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of the managed inbound Load Balancer BackendPool. Known values are: + \"NodeIPConfiguration\" and \"NodeIP\".""" + cluster_service_load_balancer_health_probe_mode: Optional[ + Union[str, "_models.ClusterServiceLoadBalancerHealthProbeMode"] + ] = rest_field( + name="clusterServiceLoadBalancerHealthProbeMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The health probing behavior for External Traffic Policy Cluster services. Known values are: + \"ServiceNodePort\" and \"Shared\".""" + + @overload + 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, + allocated_outbound_ports: Optional[int] = None, + idle_timeout_in_minutes: Optional[int] = None, + enable_multiple_standard_load_balancers: Optional[bool] = None, + backend_pool_type: Optional[Union[str, "_models.BackendPoolType"]] = None, + cluster_service_load_balancer_health_probe_mode: Optional[ + Union[str, "_models.ClusterServiceLoadBalancerHealthProbeMode"] + ] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterLoadBalancerProfileManagedOutboundIPs(_Model): # pylint: disable=name-too-long + """Desired managed outbound IPs for the cluster load balancer. + + :ivar count: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster + load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value + is 1. + :vartype count: int + :ivar count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the + cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default + value is 0 for single-stack and 1 for dual-stack. + :vartype count_ipv6: int + """ + + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.""" + count_ipv6: Optional[int] = rest_field(name="countIPv6", visibility=["read", "create", "update", "delete", "query"]) + """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.""" + + @overload + def __init__( + self, + *, + count: Optional[int] = None, + count_ipv6: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(_Model): # pylint: disable=name-too-long + """Desired outbound IP Prefix resources for the cluster load balancer. + + :ivar public_ip_prefixes: A list of public IP prefix resources. + :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.models.ResourceReference] + """ + + public_ip_prefixes: Optional[list["_models.ResourceReference"]] = rest_field( + name="publicIPPrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + """A list of public IP prefix resources.""" + + @overload + def __init__( + self, + *, + public_ip_prefixes: Optional[list["_models.ResourceReference"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterLoadBalancerProfileOutboundIPs(_Model): # pylint: disable=name-too-long + """Desired outbound IP resources for the cluster load balancer. + + :ivar public_i_ps: A list of public IP resources. + :vartype public_i_ps: list[~azure.mgmt.containerservice.models.ResourceReference] + """ + + public_i_ps: Optional[list["_models.ResourceReference"]] = rest_field( + name="publicIPs", visibility=["read", "create", "update", "delete", "query"] + ) + """A list of public IP resources.""" + + @overload + def __init__( + self, + *, + public_i_ps: Optional[list["_models.ResourceReference"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterManagedOutboundIPProfile(_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 + """ + + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """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.""" + + @overload + def __init__( + self, + *, + count: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterMetricsProfile(_Model): + """The metrics profile for the ManagedCluster. + + :ivar cost_analysis: The configuration for detailed per-Kubernetes resource cost analysis. + :vartype cost_analysis: ~azure.mgmt.containerservice.models.ManagedClusterCostAnalysis + """ + + cost_analysis: Optional["_models.ManagedClusterCostAnalysis"] = rest_field( + name="costAnalysis", visibility=["read", "create", "update", "delete", "query"] + ) + """The configuration for detailed per-Kubernetes resource cost analysis.""" + + @overload + def __init__( + self, + *, + cost_analysis: Optional["_models.ManagedClusterCostAnalysis"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterNATGatewayProfile(_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.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.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 + """ + + managed_outbound_ip_profile: Optional["_models.ManagedClusterManagedOutboundIPProfile"] = rest_field( + name="managedOutboundIPProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Profile of the managed outbound IP resources of the cluster NAT gateway.""" + effective_outbound_i_ps: Optional[list["_models.ResourceReference"]] = rest_field( + name="effectiveOutboundIPs", visibility=["read"] + ) + """The effective outbound IP resources of the cluster NAT gateway.""" + idle_timeout_in_minutes: Optional[int] = rest_field( + name="idleTimeoutInMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Desired outbound flow idle timeout in minutes. Allowed values are in the range of 4 to 120 + (inclusive). The default value is 4 minutes.""" + + @overload + def __init__( + self, + *, + managed_outbound_ip_profile: Optional["_models.ManagedClusterManagedOutboundIPProfile"] = None, + idle_timeout_in_minutes: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterNodeProvisioningProfile(_Model): + """Node provisioning profile for the managed cluster. + + :ivar mode: The node provisioning mode. If not specified, the default is Manual. Known values + are: "Manual" and "Auto". + :vartype mode: str or ~azure.mgmt.containerservice.models.NodeProvisioningMode + :ivar default_node_pools: The set of default Karpenter NodePools (CRDs) configured for node + provisioning. This field has no effect unless mode is 'Auto'. Warning: Changing this from Auto + to None on an existing cluster will cause the default Karpenter NodePools to be deleted, which + will drain and delete the nodes associated with those pools. It is strongly recommended to not + do this unless there are idle nodes ready to take the pods evicted by that action. If not + specified, the default is Auto. For more information see aka.ms/aks/nap#node-pools. Known + values are: "None" and "Auto". + :vartype default_node_pools: str or + ~azure.mgmt.containerservice.models.NodeProvisioningDefaultNodePools + """ + + mode: Optional[Union[str, "_models.NodeProvisioningMode"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The node provisioning mode. If not specified, the default is Manual. Known values are: + \"Manual\" and \"Auto\".""" + default_node_pools: Optional[Union[str, "_models.NodeProvisioningDefaultNodePools"]] = rest_field( + name="defaultNodePools", visibility=["read", "create", "update", "delete", "query"] + ) + """The set of default Karpenter NodePools (CRDs) configured for node provisioning. This field has + no effect unless mode is 'Auto'. Warning: Changing this from Auto to None on an existing + cluster will cause the default Karpenter NodePools to be deleted, which will drain and delete + the nodes associated with those pools. It is strongly recommended to not do this unless there + are idle nodes ready to take the pods evicted by that action. If not specified, the default is + Auto. For more information see aka.ms/aks/nap#node-pools. Known values are: \"None\" and + \"Auto\".""" + + @overload + def __init__( + self, + *, + mode: Optional[Union[str, "_models.NodeProvisioningMode"]] = None, + default_node_pools: Optional[Union[str, "_models.NodeProvisioningDefaultNodePools"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterNodeResourceGroupProfile(_Model): + """Node resource group lockdown profile for a managed cluster. + + :ivar restriction_level: The restriction level applied to the cluster's node resource group. If + not specified, the default is 'Unrestricted'. Known values are: "Unrestricted" and "ReadOnly". + :vartype restriction_level: str or ~azure.mgmt.containerservice.models.RestrictionLevel + """ + + restriction_level: Optional[Union[str, "_models.RestrictionLevel"]] = rest_field( + name="restrictionLevel", visibility=["read", "create", "update", "delete", "query"] + ) + """The restriction level applied to the cluster's node resource group. If not specified, the + default is 'Unrestricted'. Known values are: \"Unrestricted\" and \"ReadOnly\".""" + + @overload + def __init__( + self, + *, + restriction_level: Optional[Union[str, "_models.RestrictionLevel"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterOIDCIssuerProfile(_Model): + """The OIDC issuer profile of the Managed Cluster. + + :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 + """ + + issuer_url: Optional[str] = rest_field(name="issuerURL", visibility=["read"]) + """The OIDC issuer url of the Managed Cluster.""" + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the OIDC issuer is enabled.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterPodIdentity(_Model): + """Details about the pod identity assigned to the Managed Cluster. + + :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.models.UserAssignedIdentity + :ivar provisioning_state: The current provisioning state of the pod identity. Known values are: + "Assigned", "Canceled", "Deleting", "Failed", "Succeeded", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningState + :ivar provisioning_info: The provisioning information for the pod identity. + :vartype provisioning_info: + ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningInfo + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the pod identity. Required.""" + namespace: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace of the pod identity. Required.""" + binding_selector: Optional[str] = rest_field( + name="bindingSelector", visibility=["read", "create", "update", "delete", "query"] + ) + """The binding selector to use for the AzureIdentityBinding resource.""" + identity: "_models.UserAssignedIdentity" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The user assigned identity details. Required.""" + provisioning_state: Optional[Union[str, "_models.ManagedClusterPodIdentityProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The current provisioning state of the pod identity. Known values are: \"Assigned\", + \"Canceled\", \"Deleting\", \"Failed\", \"Succeeded\", and \"Updating\".""" + provisioning_info: Optional["_models.ManagedClusterPodIdentityProvisioningInfo"] = rest_field( + name="provisioningInfo", visibility=["read"] + ) + """The provisioning information for the pod identity.""" + + @overload + def __init__( + self, + *, + name: str, + namespace: str, + identity: "_models.UserAssignedIdentity", + binding_selector: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterPodIdentityException(_Model): + """A pod identity exception, which allows pods with certain labels to access the Azure Instance + Metadata Service (IMDS) endpoint without being intercepted by the node-managed identity (NMI) + server. See `disable AAD Pod Identity for a specific Pod/Application + `_ for more + details. + + :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] + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the pod identity exception. Required.""" + namespace: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The namespace of the pod identity exception. Required.""" + pod_labels: dict[str, str] = rest_field( + name="podLabels", visibility=["read", "create", "update", "delete", "query"] + ) + """The pod labels to match. Required.""" + + @overload + def __init__( + self, + *, + name: str, + namespace: str, + pod_labels: dict[str, str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterPodIdentityProfile(_Model): + """The pod identity profile of the Managed Cluster. 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: Whether pod identity is allowed to run on clusters with + Kubenet networking. 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.models.ManagedClusterPodIdentity] + :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. + :vartype user_assigned_identity_exceptions: + list[~azure.mgmt.containerservice.models.ManagedClusterPodIdentityException] + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether the pod identity addon is enabled.""" + allow_network_plugin_kubenet: Optional[bool] = rest_field( + name="allowNetworkPluginKubenet", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether pod identity is allowed to run on clusters with Kubenet networking. 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.""" + user_assigned_identities: Optional[list["_models.ManagedClusterPodIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The pod identities to use in the cluster.""" + user_assigned_identity_exceptions: Optional[list["_models.ManagedClusterPodIdentityException"]] = rest_field( + name="userAssignedIdentityExceptions", visibility=["read", "create", "update", "delete", "query"] + ) + """The pod identity exceptions to allow.""" + + @overload + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterPodIdentityProvisioningError(_Model): # pylint: disable=name-too-long + """An error response from the pod identity provisioning. + + :ivar error: Details about the error. + :vartype error: + ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningErrorBody + """ + + error: Optional["_models.ManagedClusterPodIdentityProvisioningErrorBody"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Details about the error.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ManagedClusterPodIdentityProvisioningErrorBody"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterPodIdentityProvisioningErrorBody(_Model): # pylint: disable=name-too-long + """An error response from the pod identity provisioning. + + :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed + programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for display in a user + interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of the property in + error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: + list[~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningErrorBody] + """ + + code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An identifier for the error. Codes are invariant and are intended to be consumed + programmatically.""" + message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A message describing the error, intended to be suitable for display in a user interface.""" + target: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target of the particular error. For example, the name of the property in error.""" + details: Optional[list["_models.ManagedClusterPodIdentityProvisioningErrorBody"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """A list of additional details about the error.""" + + @overload + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + details: Optional[list["_models.ManagedClusterPodIdentityProvisioningErrorBody"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterPodIdentityProvisioningInfo(_Model): # pylint: disable=name-too-long + """Pod identity provisioning information. + + :ivar error: Pod identity assignment error (if any). + :vartype error: ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningError + """ + + error: Optional["_models.ManagedClusterPodIdentityProvisioningError"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Pod identity assignment error (if any).""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ManagedClusterPodIdentityProvisioningError"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterPoolUpgradeProfile(_Model): + """The list of available upgrade versions. + + :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. Required. Known values are: + "Linux" and "Windows". + :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType + :ivar upgrades: List of orchestrator types and versions available for upgrade. + :vartype upgrades: + list[~azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfileUpgradesItem] + :ivar components_by_releases: List of components grouped by kubernetes major.minor version. + :vartype components_by_releases: list[~azure.mgmt.containerservice.models.ComponentsByRelease] + """ + + kubernetes_version: str = rest_field( + name="kubernetesVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The Kubernetes version (major.minor.patch). Required.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The Agent Pool name.""" + os_type: Union[str, "_models.OSType"] = rest_field( + name="osType", visibility=["read", "create", "update", "delete", "query"] + ) + """The operating system type. The default is Linux. Required. Known values are: \"Linux\" and + \"Windows\".""" + upgrades: Optional[list["_models.ManagedClusterPoolUpgradeProfileUpgradesItem"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of orchestrator types and versions available for upgrade.""" + components_by_releases: Optional[list["_models.ComponentsByRelease"]] = rest_field( + name="componentsByReleases", visibility=["read", "create", "update", "delete", "query"] + ) + """List of components grouped by kubernetes major.minor version.""" + + @overload + def __init__( + self, + *, + kubernetes_version: str, + os_type: Union[str, "_models.OSType"], + name: Optional[str] = None, + upgrades: Optional[list["_models.ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, + components_by_releases: Optional[list["_models.ComponentsByRelease"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterPoolUpgradeProfileUpgradesItem(_Model): # pylint: disable=name-too-long + """Available upgrades for an AgentPool. + + :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 + :ivar is_out_of_support: Whether the Kubernetes version is out of support. + :vartype is_out_of_support: bool + """ + + kubernetes_version: Optional[str] = rest_field( + name="kubernetesVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The Kubernetes version (major.minor.patch).""" + is_preview: Optional[bool] = rest_field( + name="isPreview", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the Kubernetes version is currently in preview.""" + is_out_of_support: Optional[bool] = rest_field( + name="isOutOfSupport", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the Kubernetes version is out of support.""" + + @overload + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + is_preview: Optional[bool] = None, + is_out_of_support: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterProperties(_Model): + """Properties of the managed cluster. + + :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.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.models.CreationData + :ivar max_agent_pools: The max number of agent pools for the managed cluster. + :vartype max_agent_pools: int + :ivar kubernetes_version: The version of Kubernetes specified by the user. Both patch version + (e.g. 1.20.13) and (e.g. 1.20) are supported. When + is specified, the latest supported GA patch version is chosen automatically. + Updating the cluster with the same once it has been created (e.g. 1.14.x -> 1.14) + will not trigger an upgrade, even if a newer patch version is available. 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. If + kubernetesVersion was a fully specified version , this field will be exactly + equal to it. If kubernetesVersion was , this field will contain the full + version being used. + :vartype current_kubernetes_version: str + :ivar dns_prefix: The DNS prefix of the Managed Cluster. This cannot be updated once the + Managed Cluster has been created. + :vartype dns_prefix: str + :ivar fqdn_subdomain: The FQDN subdomain of the private cluster with custom private dns zone. + 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 special FQDN used by the Azure Portal to access the Managed + Cluster. This FQDN is for use only by the Azure Portal and should not be used by other clients. + 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.models.ManagedClusterAgentPoolProfile] + :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. + :vartype linux_profile: ~azure.mgmt.containerservice.models.ContainerServiceLinuxProfile + :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. + :vartype windows_profile: ~azure.mgmt.containerservice.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.models.ManagedClusterServicePrincipalProfile + :ivar addon_profiles: The profile of managed cluster add-on. + :vartype addon_profiles: dict[str, + ~azure.mgmt.containerservice.models.ManagedClusterAddonProfile] + :ivar pod_identity_profile: The pod identity profile of the Managed Cluster. See `use AAD pod + identity `_ for more details on + AAD pod identity integration. + :vartype pod_identity_profile: + ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProfile + :ivar oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. + :vartype oidc_issuer_profile: + ~azure.mgmt.containerservice.models.ManagedClusterOIDCIssuerProfile + :ivar node_resource_group: The name of the resource group containing agent pool nodes. + :vartype node_resource_group: str + :ivar node_resource_group_profile: Profile of the node resource group configuration. + :vartype node_resource_group_profile: + ~azure.mgmt.containerservice.models.ManagedClusterNodeResourceGroupProfile + :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. + :vartype enable_rbac: bool + :ivar support_plan: The support plan for the Managed Cluster. If unspecified, the default is + 'KubernetesOfficial'. Known values are: "KubernetesOfficial" and "AKSLongTermSupport". + :vartype support_plan: str or ~azure.mgmt.containerservice.models.KubernetesSupportPlan + :ivar enable_namespace_resources: Enable namespace as Azure resource. The default value is + false. It can be enabled/disabled on creation and updating of the managed cluster. See + `https://aka.ms/NamespaceARMResource `_ for more details + on Namespace as a ARM Resource. + :vartype enable_namespace_resources: bool + :ivar network_profile: The network configuration profile. + :vartype network_profile: ~azure.mgmt.containerservice.models.ContainerServiceNetworkProfile + :ivar aad_profile: The Azure Active Directory configuration. + :vartype aad_profile: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile + :ivar auto_upgrade_profile: The auto upgrade configuration. + :vartype auto_upgrade_profile: + ~azure.mgmt.containerservice.models.ManagedClusterAutoUpgradeProfile + :ivar upgrade_settings: Settings for upgrading a cluster. + :vartype upgrade_settings: ~azure.mgmt.containerservice.models.ClusterUpgradeSettings + :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. + :vartype auto_scaler_profile: + ~azure.mgmt.containerservice.models.ManagedClusterPropertiesAutoScalerProfile + :ivar api_server_access_profile: The access profile for managed cluster API server. + :vartype api_server_access_profile: + ~azure.mgmt.containerservice.models.ManagedClusterAPIServerAccessProfile + :ivar disk_encryption_set_id: The Resource ID of the disk encryption set to use for enabling + encryption at rest. This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. + :vartype disk_encryption_set_id: str + :ivar identity_profile: The user identity associated with the managed cluster. This identity + will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key + is "kubeletidentity", with value of "resourceId": + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". + :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.models.UserAssignedIdentity] + :ivar private_link_resources: Private link resources associated with the cluster. + :vartype private_link_resources: list[~azure.mgmt.containerservice.models.PrivateLinkResource] + :ivar disable_local_accounts: If local accounts should be disabled on the Managed Cluster. 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.models.ManagedClusterHTTPProxyConfig + :ivar security_profile: Security profile for the managed cluster. + :vartype security_profile: ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfile + :ivar storage_profile: Storage profile for the managed cluster. + :vartype storage_profile: ~azure.mgmt.containerservice.models.ManagedClusterStorageProfile + :ivar ingress_profile: Ingress profile for the managed cluster. + :vartype ingress_profile: ~azure.mgmt.containerservice.models.ManagedClusterIngressProfile + :ivar public_network_access: PublicNetworkAccess of the managedCluster. Allow or deny public + network access for AKS. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". + :vartype public_network_access: str or ~azure.mgmt.containerservice.models.PublicNetworkAccess + :ivar workload_auto_scaler_profile: Workload Auto-scaler profile for the managed cluster. + :vartype workload_auto_scaler_profile: + ~azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfile + :ivar azure_monitor_profile: Azure Monitor addon profiles for monitoring the managed cluster. + :vartype azure_monitor_profile: + ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfile + :ivar service_mesh_profile: Service mesh profile for a managed cluster. + :vartype service_mesh_profile: ~azure.mgmt.containerservice.models.ServiceMeshProfile + :ivar resource_uid: The resourceUID uniquely identifies ManagedClusters that reuse ARM + ResourceIds (i.e: create, delete, create sequence). + :vartype resource_uid: str + :ivar metrics_profile: Optional cluster metrics configuration. + :vartype metrics_profile: ~azure.mgmt.containerservice.models.ManagedClusterMetricsProfile + :ivar node_provisioning_profile: Node provisioning settings that apply to the whole cluster. + :vartype node_provisioning_profile: + ~azure.mgmt.containerservice.models.ManagedClusterNodeProvisioningProfile + :ivar bootstrap_profile: Profile of the cluster bootstrap configuration. + :vartype bootstrap_profile: ~azure.mgmt.containerservice.models.ManagedClusterBootstrapProfile + :ivar ai_toolchain_operator_profile: AI toolchain operator settings that apply to the whole + cluster. + :vartype ai_toolchain_operator_profile: + ~azure.mgmt.containerservice.models.ManagedClusterAIToolchainOperatorProfile + :ivar scheduler_profile: Profile of the pod scheduler configuration. + :vartype scheduler_profile: ~azure.mgmt.containerservice.models.SchedulerProfile + :ivar hosted_system_profile: Settings for hosted system addons. For more information, see + `https://aka.ms/aks/automatic/systemcomponents + `_. + :vartype hosted_system_profile: + ~azure.mgmt.containerservice.models.ManagedClusterHostedSystemProfile + :ivar status: Contains read-only information about the Managed Cluster. + :vartype status: ~azure.mgmt.containerservice.models.ManagedClusterStatus + """ + + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The current provisioning state.""" + power_state: Optional["_models.PowerState"] = rest_field(name="powerState", visibility=["read"]) + """The Power State of the cluster.""" + creation_data: Optional["_models.CreationData"] = rest_field( + name="creationData", visibility=["read", "create", "update", "delete", "query"] + ) + """CreationData to be used to specify the source Snapshot ID if the cluster will be + created/upgraded using a snapshot.""" + max_agent_pools: Optional[int] = rest_field(name="maxAgentPools", visibility=["read"]) + """The max number of agent pools for the managed cluster.""" + kubernetes_version: Optional[str] = rest_field( + name="kubernetesVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The version of Kubernetes specified by the user. Both patch version (e.g. + 1.20.13) and (e.g. 1.20) are supported. When is specified, the + latest supported GA patch version is chosen automatically. Updating the cluster with the same + once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even + if a newer patch version is available. 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.""" + current_kubernetes_version: Optional[str] = rest_field(name="currentKubernetesVersion", visibility=["read"]) + """The version of Kubernetes the Managed Cluster is running. If kubernetesVersion was a fully + specified version , this field will be exactly equal to it. If + kubernetesVersion was , this field will contain the full + version being used.""" + dns_prefix: Optional[str] = rest_field(name="dnsPrefix", visibility=["read", "create", "update", "delete", "query"]) + """The DNS prefix of the Managed Cluster. This cannot be updated once the Managed Cluster has been + created.""" + fqdn_subdomain: Optional[str] = rest_field( + name="fqdnSubdomain", visibility=["read", "create", "update", "delete", "query"] + ) + """The FQDN subdomain of the private cluster with custom private dns zone. This cannot be updated + once the Managed Cluster has been created.""" + fqdn: Optional[str] = rest_field(visibility=["read"]) + """The FQDN of the master pool.""" + private_fqdn: Optional[str] = rest_field(name="privateFQDN", visibility=["read"]) + """The FQDN of private cluster.""" + azure_portal_fqdn: Optional[str] = rest_field(name="azurePortalFQDN", visibility=["read"]) + """The special FQDN used by the Azure Portal to access the Managed Cluster. This FQDN is for use + only by the Azure Portal and should not be used by other clients. 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.""" + agent_pool_profiles: Optional[list["_models.ManagedClusterAgentPoolProfile"]] = rest_field( + name="agentPoolProfiles", visibility=["read", "create", "update", "delete", "query"] + ) + """The agent pool properties.""" + linux_profile: Optional["_models.ContainerServiceLinuxProfile"] = rest_field( + name="linuxProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The profile for Linux VMs in the Managed Cluster.""" + windows_profile: Optional["_models.ManagedClusterWindowsProfile"] = rest_field( + name="windowsProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The profile for Windows VMs in the Managed Cluster.""" + service_principal_profile: Optional["_models.ManagedClusterServicePrincipalProfile"] = rest_field( + name="servicePrincipalProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Information about a service principal identity for the cluster to use for manipulating Azure + APIs.""" + addon_profiles: Optional[dict[str, "_models.ManagedClusterAddonProfile"]] = rest_field( + name="addonProfiles", visibility=["read", "create", "update", "delete", "query"] + ) + """The profile of managed cluster add-on.""" + pod_identity_profile: Optional["_models.ManagedClusterPodIdentityProfile"] = rest_field( + name="podIdentityProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The pod identity profile of the Managed Cluster. See `use AAD pod identity + `_ for more details on AAD pod + identity integration.""" + oidc_issuer_profile: Optional["_models.ManagedClusterOIDCIssuerProfile"] = rest_field( + name="oidcIssuerProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The OIDC issuer profile of the Managed Cluster.""" + node_resource_group: Optional[str] = rest_field( + name="nodeResourceGroup", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the resource group containing agent pool nodes.""" + node_resource_group_profile: Optional["_models.ManagedClusterNodeResourceGroupProfile"] = rest_field( + name="nodeResourceGroupProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Profile of the node resource group configuration.""" + enable_rbac: Optional[bool] = rest_field( + name="enableRBAC", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to enable Kubernetes Role-Based Access Control.""" + support_plan: Optional[Union[str, "_models.KubernetesSupportPlan"]] = rest_field( + name="supportPlan", visibility=["read", "create", "update", "delete", "query"] + ) + """The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'. + Known values are: \"KubernetesOfficial\" and \"AKSLongTermSupport\".""" + enable_namespace_resources: Optional[bool] = rest_field( + name="enableNamespaceResources", visibility=["read", "create", "update", "delete", "query"] + ) + """Enable namespace as Azure resource. The default value is false. It can be enabled/disabled on + creation and updating of the managed cluster. See `https://aka.ms/NamespaceARMResource + `_ for more details on Namespace as a ARM Resource.""" + network_profile: Optional["_models.ContainerServiceNetworkProfile"] = rest_field( + name="networkProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The network configuration profile.""" + aad_profile: Optional["_models.ManagedClusterAADProfile"] = rest_field( + name="aadProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure Active Directory configuration.""" + auto_upgrade_profile: Optional["_models.ManagedClusterAutoUpgradeProfile"] = rest_field( + name="autoUpgradeProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The auto upgrade configuration.""" + upgrade_settings: Optional["_models.ClusterUpgradeSettings"] = rest_field( + name="upgradeSettings", visibility=["read", "create", "update", "delete", "query"] + ) + """Settings for upgrading a cluster.""" + auto_scaler_profile: Optional["_models.ManagedClusterPropertiesAutoScalerProfile"] = rest_field( + name="autoScalerProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Parameters to be applied to the cluster-autoscaler when enabled.""" + api_server_access_profile: Optional["_models.ManagedClusterAPIServerAccessProfile"] = rest_field( + name="apiServerAccessProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The access profile for managed cluster API server.""" + disk_encryption_set_id: Optional[str] = rest_field( + name="diskEncryptionSetID", visibility=["read", "create", "update", "delete", "query"] + ) + """The Resource ID of the disk encryption set to use for enabling encryption at rest. This is of + the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'.""" + identity_profile: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="identityProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The user identity associated with the managed cluster. This identity will be used by the + kubelet. Only one user assigned identity is allowed. The only accepted key is + \"kubeletidentity\", with value of \"resourceId\": + \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}\".""" + private_link_resources: Optional[list["_models.PrivateLinkResource"]] = rest_field( + name="privateLinkResources", visibility=["read", "create", "update", "delete", "query"] + ) + """Private link resources associated with the cluster.""" + disable_local_accounts: Optional[bool] = rest_field( + name="disableLocalAccounts", visibility=["read", "create", "update", "delete", "query"] + ) + """If local accounts should be disabled on the Managed Cluster. 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 + `_.""" + http_proxy_config: Optional["_models.ManagedClusterHTTPProxyConfig"] = rest_field( + name="httpProxyConfig", visibility=["read", "create", "update", "delete", "query"] + ) + """Configurations for provisioning the cluster with HTTP proxy servers.""" + security_profile: Optional["_models.ManagedClusterSecurityProfile"] = rest_field( + name="securityProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Security profile for the managed cluster.""" + storage_profile: Optional["_models.ManagedClusterStorageProfile"] = rest_field( + name="storageProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage profile for the managed cluster.""" + ingress_profile: Optional["_models.ManagedClusterIngressProfile"] = rest_field( + name="ingressProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Ingress profile for the managed cluster.""" + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field( + name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"] + ) + """PublicNetworkAccess of the managedCluster. Allow or deny public network access for AKS. Known + values are: \"Enabled\", \"Disabled\", and \"SecuredByPerimeter\".""" + workload_auto_scaler_profile: Optional["_models.ManagedClusterWorkloadAutoScalerProfile"] = rest_field( + name="workloadAutoScalerProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Workload Auto-scaler profile for the managed cluster.""" + azure_monitor_profile: Optional["_models.ManagedClusterAzureMonitorProfile"] = rest_field( + name="azureMonitorProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Monitor addon profiles for monitoring the managed cluster.""" + service_mesh_profile: Optional["_models.ServiceMeshProfile"] = rest_field( + name="serviceMeshProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Service mesh profile for a managed cluster.""" + resource_uid: Optional[str] = rest_field(name="resourceUID", visibility=["read"]) + """The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, + delete, create sequence).""" + metrics_profile: Optional["_models.ManagedClusterMetricsProfile"] = rest_field( + name="metricsProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Optional cluster metrics configuration.""" + node_provisioning_profile: Optional["_models.ManagedClusterNodeProvisioningProfile"] = rest_field( + name="nodeProvisioningProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Node provisioning settings that apply to the whole cluster.""" + bootstrap_profile: Optional["_models.ManagedClusterBootstrapProfile"] = rest_field( + name="bootstrapProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Profile of the cluster bootstrap configuration.""" + ai_toolchain_operator_profile: Optional["_models.ManagedClusterAIToolchainOperatorProfile"] = rest_field( + name="aiToolchainOperatorProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """AI toolchain operator settings that apply to the whole cluster.""" + scheduler_profile: Optional["_models.SchedulerProfile"] = rest_field( + name="schedulerProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Profile of the pod scheduler configuration.""" + hosted_system_profile: Optional["_models.ManagedClusterHostedSystemProfile"] = rest_field( + name="hostedSystemProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """Settings for hosted system addons. For more information, see + `https://aka.ms/aks/automatic/systemcomponents + `_.""" + status: Optional["_models.ManagedClusterStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Contains read-only information about the Managed Cluster.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + creation_data: Optional["_models.CreationData"] = None, + kubernetes_version: Optional[str] = None, + dns_prefix: Optional[str] = None, + fqdn_subdomain: Optional[str] = None, + agent_pool_profiles: Optional[list["_models.ManagedClusterAgentPoolProfile"]] = None, + linux_profile: Optional["_models.ContainerServiceLinuxProfile"] = None, + windows_profile: Optional["_models.ManagedClusterWindowsProfile"] = None, + service_principal_profile: Optional["_models.ManagedClusterServicePrincipalProfile"] = None, + addon_profiles: Optional[dict[str, "_models.ManagedClusterAddonProfile"]] = None, + pod_identity_profile: Optional["_models.ManagedClusterPodIdentityProfile"] = None, + oidc_issuer_profile: Optional["_models.ManagedClusterOIDCIssuerProfile"] = None, + node_resource_group: Optional[str] = None, + node_resource_group_profile: Optional["_models.ManagedClusterNodeResourceGroupProfile"] = None, + enable_rbac: Optional[bool] = None, + support_plan: Optional[Union[str, "_models.KubernetesSupportPlan"]] = None, + enable_namespace_resources: Optional[bool] = None, + network_profile: Optional["_models.ContainerServiceNetworkProfile"] = None, + aad_profile: Optional["_models.ManagedClusterAADProfile"] = None, + auto_upgrade_profile: Optional["_models.ManagedClusterAutoUpgradeProfile"] = None, + upgrade_settings: Optional["_models.ClusterUpgradeSettings"] = None, + auto_scaler_profile: Optional["_models.ManagedClusterPropertiesAutoScalerProfile"] = None, + api_server_access_profile: Optional["_models.ManagedClusterAPIServerAccessProfile"] = None, + disk_encryption_set_id: Optional[str] = None, + identity_profile: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + private_link_resources: Optional[list["_models.PrivateLinkResource"]] = None, + disable_local_accounts: Optional[bool] = None, + http_proxy_config: Optional["_models.ManagedClusterHTTPProxyConfig"] = None, + security_profile: Optional["_models.ManagedClusterSecurityProfile"] = None, + storage_profile: Optional["_models.ManagedClusterStorageProfile"] = None, + ingress_profile: Optional["_models.ManagedClusterIngressProfile"] = None, + public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, + workload_auto_scaler_profile: Optional["_models.ManagedClusterWorkloadAutoScalerProfile"] = None, + azure_monitor_profile: Optional["_models.ManagedClusterAzureMonitorProfile"] = None, + service_mesh_profile: Optional["_models.ServiceMeshProfile"] = None, + metrics_profile: Optional["_models.ManagedClusterMetricsProfile"] = None, + node_provisioning_profile: Optional["_models.ManagedClusterNodeProvisioningProfile"] = None, + bootstrap_profile: Optional["_models.ManagedClusterBootstrapProfile"] = None, + ai_toolchain_operator_profile: Optional["_models.ManagedClusterAIToolchainOperatorProfile"] = None, + scheduler_profile: Optional["_models.SchedulerProfile"] = None, + hosted_system_profile: Optional["_models.ManagedClusterHostedSystemProfile"] = None, + status: Optional["_models.ManagedClusterStatus"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterPropertiesAutoScalerProfile(_Model): # pylint: disable=name-too-long + """Parameters to be applied to the cluster-autoscaler when enabled. + + :ivar balance_similar_node_groups: Detects similar node pools and balances the number of nodes + between them. Valid values are 'true' and 'false'. + :vartype balance_similar_node_groups: str + :ivar daemonset_eviction_for_empty_nodes: DaemonSet pods will be gracefully terminated from + empty nodes. If set to true, all daemonset pods on empty nodes will be evicted before deletion + of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If + set to false, the node will be deleted without ensuring that daemonset pods are deleted or + evicted. + :vartype daemonset_eviction_for_empty_nodes: bool + :ivar daemonset_eviction_for_occupied_nodes: DaemonSet pods will be gracefully terminated from + non-empty nodes. If set to true, all daemonset pods on occupied nodes will be evicted before + deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for + scaling. If set to false, the node will be deleted without ensuring that daemonset pods are + deleted or evicted. + :vartype daemonset_eviction_for_occupied_nodes: bool + :ivar ignore_daemonsets_utilization: Should CA ignore DaemonSet pods when calculating resource + utilization for scaling down. If set to true, the resources used by daemonset will be taken + into account when making scaling down decisions. + :vartype ignore_daemonsets_utilization: bool + :ivar expander: The expander to use when scaling up. 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.models.Expander + :ivar max_empty_bulk_delete: The maximum number of empty nodes that can be deleted at the same + time. This must be a positive integer. The default is 10. + :vartype max_empty_bulk_delete: str + :ivar max_graceful_termination_sec: The maximum number of seconds the cluster autoscaler waits + for pod termination when trying to scale down a node. The default is 600. + :vartype max_graceful_termination_sec: str + :ivar max_node_provision_time: The maximum time the autoscaler waits for a node to be + provisioned. 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 maximum percentage of unready nodes in the cluster. + After this percentage is exceeded, cluster autoscaler halts operations. 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: Ignore unscheduled pods before they're a certain age. 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: The number of allowed unready nodes, irrespective of + max-total-unready-percentage. This must be an integer. The default is 3. + :vartype ok_total_unready_count: str + :ivar scan_interval: How often cluster is reevaluated for scale up or down. The default is + '10'. Values must be an integer number of seconds. + :vartype scan_interval: str + :ivar scale_down_delay_after_add: How long after scale up that scale down evaluation resumes. + 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: How long after node deletion that scale down evaluation + resumes. 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: How long after scale down failure that scale down + evaluation resumes. 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: How long a node should be unneeded before it is eligible for + scale down. 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: How long an unready node should be unneeded before it is + eligible for scale down. 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: Node utilization level, defined as sum of requested + resources divided by capacity, below which a node can be considered for scale down. The default + is '0.5'. + :vartype scale_down_utilization_threshold: str + :ivar skip_nodes_with_local_storage: If cluster autoscaler will skip deleting nodes with pods + with local storage, for example, EmptyDir or HostPath. The default is true. + :vartype skip_nodes_with_local_storage: str + :ivar skip_nodes_with_system_pods: If cluster autoscaler will skip deleting nodes with pods + from kube-system (except for DaemonSet or mirror pods). The default is true. + :vartype skip_nodes_with_system_pods: str + """ + + balance_similar_node_groups: Optional[str] = rest_field( + name="balance-similar-node-groups", visibility=["read", "create", "update", "delete", "query"] + ) + """Detects similar node pools and balances the number of nodes between them. Valid values are + 'true' and 'false'.""" + daemonset_eviction_for_empty_nodes: Optional[bool] = rest_field( + name="daemonset-eviction-for-empty-nodes", visibility=["read", "create", "update", "delete", "query"] + ) + """DaemonSet pods will be gracefully terminated from empty nodes. If set to true, all daemonset + pods on empty nodes will be evicted before deletion of the node. If the daemonset pod cannot be + evicted another node will be chosen for scaling. If set to false, the node will be deleted + without ensuring that daemonset pods are deleted or evicted.""" + daemonset_eviction_for_occupied_nodes: Optional[bool] = rest_field( + name="daemonset-eviction-for-occupied-nodes", visibility=["read", "create", "update", "delete", "query"] + ) + """DaemonSet pods will be gracefully terminated from non-empty nodes. If set to true, all + daemonset pods on occupied nodes will be evicted before deletion of the node. If the daemonset + pod cannot be evicted another node will be chosen for scaling. If set to false, the node will + be deleted without ensuring that daemonset pods are deleted or evicted.""" + ignore_daemonsets_utilization: Optional[bool] = rest_field( + name="ignore-daemonsets-utilization", visibility=["read", "create", "update", "delete", "query"] + ) + """Should CA ignore DaemonSet pods when calculating resource utilization for scaling down. If set + to true, the resources used by daemonset will be taken into account when making scaling down + decisions.""" + expander: Optional[Union[str, "_models.Expander"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The expander to use when scaling up. If not specified, the default is 'random'. See `expanders + `_ + for more information. Known values are: \"least-waste\", \"most-pods\", \"priority\", and + \"random\".""" + max_empty_bulk_delete: Optional[str] = rest_field( + name="max-empty-bulk-delete", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number of empty nodes that can be deleted at the same time. This must be a positive + integer. The default is 10.""" + max_graceful_termination_sec: Optional[str] = rest_field( + name="max-graceful-termination-sec", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum number of seconds the cluster autoscaler waits for pod termination when trying to + scale down a node. The default is 600.""" + max_node_provision_time: Optional[str] = rest_field( + name="max-node-provision-time", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum time the autoscaler waits for a node to be provisioned. The default is '15m'. + Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + supported.""" + max_total_unready_percentage: Optional[str] = rest_field( + name="max-total-unready-percentage", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum percentage of unready nodes in the cluster. After this percentage is exceeded, + cluster autoscaler halts operations. The default is 45. The maximum is 100 and the minimum is + 0.""" + new_pod_scale_up_delay: Optional[str] = rest_field( + name="new-pod-scale-up-delay", visibility=["read", "create", "update", "delete", "query"] + ) + """Ignore unscheduled pods before they're a certain age. 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).""" + ok_total_unready_count: Optional[str] = rest_field( + name="ok-total-unready-count", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of allowed unready nodes, irrespective of max-total-unready-percentage. This must be + an integer. The default is 3.""" + scan_interval: Optional[str] = rest_field( + name="scan-interval", visibility=["read", "create", "update", "delete", "query"] + ) + """How often cluster is reevaluated for scale up or down. The default is '10'. Values must be an + integer number of seconds.""" + scale_down_delay_after_add: Optional[str] = rest_field( + name="scale-down-delay-after-add", visibility=["read", "create", "update", "delete", "query"] + ) + """How long after scale up that scale down evaluation resumes. The default is '10m'. Values must + be an integer followed by an 'm'. No unit of time other than minutes (m) is supported.""" + scale_down_delay_after_delete: Optional[str] = rest_field( + name="scale-down-delay-after-delete", visibility=["read", "create", "update", "delete", "query"] + ) + """How long after node deletion that scale down evaluation resumes. 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.""" + scale_down_delay_after_failure: Optional[str] = rest_field( + name="scale-down-delay-after-failure", visibility=["read", "create", "update", "delete", "query"] + ) + """How long after scale down failure that scale down evaluation resumes. The default is '3m'. + Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + supported.""" + scale_down_unneeded_time: Optional[str] = rest_field( + name="scale-down-unneeded-time", visibility=["read", "create", "update", "delete", "query"] + ) + """How long a node should be unneeded before it is eligible for scale down. The default is '10m'. + Values must be an integer followed by an 'm'. No unit of time other than minutes (m) is + supported.""" + scale_down_unready_time: Optional[str] = rest_field( + name="scale-down-unready-time", visibility=["read", "create", "update", "delete", "query"] + ) + """How long an unready node should be unneeded before it is eligible for scale down. The default + is '20m'. Values must be an integer followed by an 'm'. No unit of time other than minutes (m) + is supported.""" + scale_down_utilization_threshold: Optional[str] = rest_field( + name="scale-down-utilization-threshold", visibility=["read", "create", "update", "delete", "query"] + ) + """Node utilization level, defined as sum of requested resources divided by capacity, below which + a node can be considered for scale down. The default is '0.5'.""" + skip_nodes_with_local_storage: Optional[str] = rest_field( + name="skip-nodes-with-local-storage", visibility=["read", "create", "update", "delete", "query"] + ) + """If cluster autoscaler will skip deleting nodes with pods with local storage, for example, + EmptyDir or HostPath. The default is true.""" + skip_nodes_with_system_pods: Optional[str] = rest_field( + name="skip-nodes-with-system-pods", visibility=["read", "create", "update", "delete", "query"] + ) + """If cluster autoscaler will skip deleting nodes with pods from kube-system (except for DaemonSet + or mirror pods). The default is true.""" + + @overload + def __init__( + self, + *, + balance_similar_node_groups: Optional[str] = None, + daemonset_eviction_for_empty_nodes: Optional[bool] = None, + daemonset_eviction_for_occupied_nodes: Optional[bool] = None, + ignore_daemonsets_utilization: Optional[bool] = None, + expander: Optional[Union[str, "_models.Expander"]] = None, + max_empty_bulk_delete: Optional[str] = None, + max_graceful_termination_sec: Optional[str] = None, + max_node_provision_time: Optional[str] = None, + max_total_unready_percentage: Optional[str] = None, + new_pod_scale_up_delay: Optional[str] = None, + ok_total_unready_count: Optional[str] = None, + scan_interval: Optional[str] = None, + scale_down_delay_after_add: Optional[str] = None, + scale_down_delay_after_delete: Optional[str] = None, + scale_down_delay_after_failure: Optional[str] = None, + scale_down_unneeded_time: Optional[str] = None, + scale_down_unready_time: Optional[str] = None, + scale_down_utilization_threshold: Optional[str] = None, + skip_nodes_with_local_storage: Optional[str] = None, + skip_nodes_with_system_pods: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterPropertiesForSnapshot(_Model): + """managed cluster properties for snapshot, these properties are read only. + + :ivar kubernetes_version: The current kubernetes version. + :vartype kubernetes_version: str + :ivar sku: The current managed cluster sku. + :vartype sku: ~azure.mgmt.containerservice.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.models.NetworkProfileForSnapshot + """ + + kubernetes_version: Optional[str] = rest_field( + name="kubernetesVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """The current kubernetes version.""" + sku: Optional["_models.ManagedClusterSKU"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The current managed cluster sku.""" + enable_rbac: Optional[bool] = rest_field( + name="enableRbac", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the cluster has enabled Kubernetes Role-Based Access Control or not.""" + network_profile: Optional["_models.NetworkProfileForSnapshot"] = rest_field( + name="networkProfile", visibility=["read"] + ) + """The current network profile.""" + + @overload + def __init__( + self, + *, + kubernetes_version: Optional[str] = None, + sku: Optional["_models.ManagedClusterSKU"] = None, + enable_rbac: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSecurityProfile(_Model): + """Security profile for the container service cluster. + + :ivar defender: Microsoft Defender settings for the security profile. + :vartype defender: ~azure.mgmt.containerservice.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.models.AzureKeyVaultKms + :ivar kubernetes_resource_object_encryption_profile: Encryption at rest of Kubernetes resource + objects. More information on this can be found under + `https://aka.ms/aks/kubernetesResourceObjectEncryption + `_. + :vartype kubernetes_resource_object_encryption_profile: + ~azure.mgmt.containerservice.models.KubernetesResourceObjectEncryptionProfile + :ivar workload_identity: Workload identity settings for the security profile. Workload identity + enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See + `https://aka.ms/aks/wi `_ for more details. + :vartype workload_identity: + ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileWorkloadIdentity + :ivar image_cleaner: Image Cleaner settings for the security profile. + :vartype image_cleaner: + ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileImageCleaner + :ivar image_integrity: Image integrity is a feature that works with Azure Policy to verify + image integrity by signature. This will not have any effect unless Azure Policy is applied to + enforce image signatures. See `https://aka.ms/aks/image-integrity + `_ for how to use this feature via policy. + :vartype image_integrity: + ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileImageIntegrity + :ivar node_restriction: `Node Restriction + `_ + settings for the security profile. + :vartype node_restriction: + ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileNodeRestriction + :ivar custom_ca_trust_certificates: A list of up to 10 base64 encoded CAs that will be added to + the trust store on all nodes in the cluster. For more information see `Custom CA Trust + Certificates `_. + :vartype custom_ca_trust_certificates: list[bytes] + """ + + defender: Optional["_models.ManagedClusterSecurityProfileDefender"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Microsoft Defender settings for the security profile.""" + azure_key_vault_kms: Optional["_models.AzureKeyVaultKms"] = rest_field( + name="azureKeyVaultKms", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Key Vault `key management service + `_ settings for the security + profile.""" + kubernetes_resource_object_encryption_profile: Optional["_models.KubernetesResourceObjectEncryptionProfile"] = ( + rest_field( + name="kubernetesResourceObjectEncryptionProfile", visibility=["read", "create", "update", "delete", "query"] + ) + ) + """Encryption at rest of Kubernetes resource objects. More information on this can be found under + `https://aka.ms/aks/kubernetesResourceObjectEncryption + `_.""" + workload_identity: Optional["_models.ManagedClusterSecurityProfileWorkloadIdentity"] = rest_field( + name="workloadIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """Workload identity settings for the security profile. Workload identity enables Kubernetes + applications to access Azure cloud resources securely with Azure AD. See `https://aka.ms/aks/wi + `_ for more details.""" + image_cleaner: Optional["_models.ManagedClusterSecurityProfileImageCleaner"] = rest_field( + name="imageCleaner", visibility=["read", "create", "update", "delete", "query"] + ) + """Image Cleaner settings for the security profile.""" + image_integrity: Optional["_models.ManagedClusterSecurityProfileImageIntegrity"] = rest_field( + name="imageIntegrity", visibility=["read", "create", "update", "delete", "query"] + ) + """Image integrity is a feature that works with Azure Policy to verify image integrity by + signature. This will not have any effect unless Azure Policy is applied to enforce image + signatures. See `https://aka.ms/aks/image-integrity `_ for + how to use this feature via policy.""" + node_restriction: Optional["_models.ManagedClusterSecurityProfileNodeRestriction"] = rest_field( + name="nodeRestriction", visibility=["read", "create", "update", "delete", "query"] + ) + """`Node Restriction + `_ + settings for the security profile.""" + custom_ca_trust_certificates: Optional[list[bytes]] = rest_field( + name="customCATrustCertificates", visibility=["read", "create", "update", "delete", "query"], format="base64" + ) + """A list of up to 10 base64 encoded CAs that will be added to the trust store on all nodes in the + cluster. For more information see `Custom CA Trust Certificates + `_.""" + + @overload + def __init__( + self, + *, + defender: Optional["_models.ManagedClusterSecurityProfileDefender"] = None, + azure_key_vault_kms: Optional["_models.AzureKeyVaultKms"] = None, + kubernetes_resource_object_encryption_profile: Optional[ + "_models.KubernetesResourceObjectEncryptionProfile" + ] = None, + workload_identity: Optional["_models.ManagedClusterSecurityProfileWorkloadIdentity"] = None, + image_cleaner: Optional["_models.ManagedClusterSecurityProfileImageCleaner"] = None, + image_integrity: Optional["_models.ManagedClusterSecurityProfileImageIntegrity"] = None, + node_restriction: Optional["_models.ManagedClusterSecurityProfileNodeRestriction"] = None, + custom_ca_trust_certificates: Optional[list[bytes]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSecurityProfileDefender(_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.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring + :ivar security_gating: Microsoft Defender settings for security gating, validates container + images eligibility for deployment based on Defender for Containers security findings. Using + Admission Controller, it either audits or prevents the deployment of images that do not meet + security standards. + :vartype security_gating: + ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityGating + """ + + log_analytics_workspace_resource_id: Optional[str] = rest_field( + name="logAnalyticsWorkspaceResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + security_monitoring: Optional["_models.ManagedClusterSecurityProfileDefenderSecurityMonitoring"] = rest_field( + name="securityMonitoring", visibility=["read", "create", "update", "delete", "query"] + ) + """Microsoft Defender threat detection for Cloud settings for the security profile.""" + security_gating: Optional["_models.ManagedClusterSecurityProfileDefenderSecurityGating"] = rest_field( + name="securityGating", visibility=["read", "create", "update", "delete", "query"] + ) + """Microsoft Defender settings for security gating, validates container images eligibility for + deployment based on Defender for Containers security findings. Using Admission Controller, it + either audits or prevents the deployment of images that do not meet security standards.""" + + @overload + def __init__( + self, + *, + log_analytics_workspace_resource_id: Optional[str] = None, + security_monitoring: Optional["_models.ManagedClusterSecurityProfileDefenderSecurityMonitoring"] = None, + security_gating: Optional["_models.ManagedClusterSecurityProfileDefenderSecurityGating"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSecurityProfileDefenderSecurityGating(_Model): # pylint: disable=name-too-long + """Microsoft Defender settings for security gating, validates container images eligibility for + deployment based on Defender for Containers security findings. Using Admission Controller, it + either audits or prevents the deployment of images that do not meet security standards. + + :ivar enabled: Whether to enable Defender security gating. When enabled, the gating feature + will scan container images and audit or block the deployment of images that do not meet + security standards according to the configured security rules. + :vartype enabled: bool + :ivar identities: List of identities that the admission controller will make use of in order to + pull security artifacts from the registry. These are the same identities used by the cluster to + pull container images. Each identity provided should have federated identity credential + attached to it. + :vartype identities: + list[~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem] + :ivar allow_secret_access: In use only while registry access granted by secret rather than + managed identity. Set whether to grant the Defender gating agent access to the cluster's + secrets for pulling images from registries. If secret access is denied and the registry + requires pull secrets, the add-on will not perform any image validation. Default value is + false. + :vartype allow_secret_access: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable Defender security gating. When enabled, the gating feature will scan + container images and audit or block the deployment of images that do not meet security + standards according to the configured security rules.""" + identities: Optional[list["_models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem"]] = ( + rest_field(visibility=["read", "create", "update", "delete", "query"]) + ) + """List of identities that the admission controller will make use of in order to pull security + artifacts from the registry. These are the same identities used by the cluster to pull + container images. Each identity provided should have federated identity credential attached to + it.""" + allow_secret_access: Optional[bool] = rest_field( + name="allowSecretAccess", visibility=["read", "create", "update", "delete", "query"] + ) + """In use only while registry access granted by secret rather than managed identity. Set whether + to grant the Defender gating agent access to the cluster's secrets for pulling images from + registries. If secret access is denied and the registry requires pull secrets, the add-on will + not perform any image validation. Default value is false.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + identities: Optional[list["_models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem"]] = None, + allow_secret_access: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem(_Model): # pylint: disable=name-too-long + """Identity information used by Defender security gating to access container registries. + + :ivar azure_container_registry: The container registry for which the identity will be used; the + identity specified here should have a federated identity credential attached to it. + :vartype azure_container_registry: str + :ivar identity: The identity object used to access the registry. + :vartype identity: ~azure.mgmt.containerservice.models.UserAssignedIdentity + """ + + azure_container_registry: Optional[str] = rest_field( + name="azureContainerRegistry", visibility=["read", "create", "update", "delete", "query"] + ) + """The container registry for which the identity will be used; the identity specified here should + have a federated identity credential attached to it.""" + identity: Optional["_models.UserAssignedIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The identity object used to access the registry.""" + + @overload + def __init__( + self, + *, + azure_container_registry: Optional[str] = None, + identity: Optional["_models.UserAssignedIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSecurityProfileDefenderSecurityMonitoring(_Model): # pylint: disable=name-too-long + """Microsoft Defender settings for the security profile threat detection. + + :ivar enabled: Whether to enable Defender threat detection. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable Defender threat detection.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSecurityProfileImageCleaner(_Model): # pylint: disable=name-too-long + """Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce + attack surface area. Here are settings for the security profile. + + :ivar enabled: Whether to enable Image Cleaner on AKS cluster. + :vartype enabled: bool + :ivar interval_hours: Image Cleaner scanning interval in hours. + :vartype interval_hours: int + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable Image Cleaner on AKS cluster.""" + interval_hours: Optional[int] = rest_field( + name="intervalHours", visibility=["read", "create", "update", "delete", "query"] + ) + """Image Cleaner scanning interval in hours.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + interval_hours: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSecurityProfileImageIntegrity(_Model): # pylint: disable=name-too-long + """Image integrity related settings for the security profile. + + :ivar enabled: Whether to enable image integrity. The default value is false. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable image integrity. The default value is false.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSecurityProfileNodeRestriction(_Model): # pylint: disable=name-too-long + """Node Restriction settings for the security profile. + + :ivar enabled: Whether to enable Node Restriction. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable Node Restriction.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSecurityProfileWorkloadIdentity(_Model): # pylint: disable=name-too-long + """Workload identity settings for the security profile. + + :ivar enabled: Whether to enable workload identity. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable workload identity.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterServicePrincipalProfile(_Model): + """Information about a service principal identity for the cluster to use for manipulating Azure + APIs. + + :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 + """ + + client_id: str = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"]) + """The ID for the service principal. Required.""" + secret: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The secret password associated with the service principal in plain text.""" + + @overload + def __init__( + self, + *, + client_id: str, + secret: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSKU(_Model): + """The SKU of a Managed Cluster. + + :ivar name: The name of a managed cluster SKU. Known values are: "Base" and "Automatic". + :vartype name: str or ~azure.mgmt.containerservice.models.ManagedClusterSKUName + :ivar tier: The tier of a managed cluster SKU. If not specified, the default is 'Free'. See + `AKS Pricing Tier `_ for + more details. Known values are: "Premium", "Standard", and "Free". + :vartype tier: str or ~azure.mgmt.containerservice.models.ManagedClusterSKUTier + """ + + name: Optional[Union[str, "_models.ManagedClusterSKUName"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The name of a managed cluster SKU. Known values are: \"Base\" and \"Automatic\".""" + tier: Optional[Union[str, "_models.ManagedClusterSKUTier"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The tier of a managed cluster SKU. If not specified, the default is 'Free'. See `AKS Pricing + Tier `_ for more details. + Known values are: \"Premium\", \"Standard\", and \"Free\".""" + + @overload + def __init__( + self, + *, + name: Optional[Union[str, "_models.ManagedClusterSKUName"]] = None, + tier: Optional[Union[str, "_models.ManagedClusterSKUTier"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterSnapshot(TrackedResource): + """A managed cluster snapshot resource. + + :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.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 properties: Properties of a managed cluster snapshot. + :vartype properties: ~azure.mgmt.containerservice.models.ManagedClusterSnapshotProperties + """ + + properties: Optional["_models.ManagedClusterSnapshotProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of a managed cluster snapshot.""" + + __flattened_items = ["creation_data", "snapshot_type", "managed_cluster_properties_read_only"] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ManagedClusterSnapshotProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedClusterSnapshotProperties(_Model): + """Properties for a managed cluster snapshot. + + :ivar creation_data: CreationData to be used to specify the source resource ID to create this + snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.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.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.models.ManagedClusterPropertiesForSnapshot + """ + + creation_data: Optional["_models.CreationData"] = rest_field( + name="creationData", visibility=["read", "create", "update", "delete", "query"] + ) + """CreationData to be used to specify the source resource ID to create this snapshot.""" + snapshot_type: Optional[Union[str, "_models.SnapshotType"]] = rest_field( + name="snapshotType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of a snapshot. The default is NodePool. Known values are: \"NodePool\" and + \"ManagedCluster\".""" + managed_cluster_properties_read_only: Optional["_models.ManagedClusterPropertiesForSnapshot"] = rest_field( + name="managedClusterPropertiesReadOnly", visibility=["read"] + ) + """What the properties will be showed when getting managed cluster snapshot. Those properties are + read-only.""" + + @overload + def __init__( + self, + *, + creation_data: Optional["_models.CreationData"] = None, + snapshot_type: Optional[Union[str, "_models.SnapshotType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterStaticEgressGatewayProfile(_Model): + """The Static Egress Gateway addon configuration for the cluster. + + :ivar enabled: Enable Static Egress Gateway addon. Indicates if Static Egress Gateway addon is + enabled or not. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Enable Static Egress Gateway addon. Indicates if Static Egress Gateway addon is enabled or not.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterStatus(_Model): + """Contains read-only information about the Managed Cluster. + + :ivar provisioning_error: The error details information of the managed cluster. Preserves the + detailed info of failure. If there was no error, this field is omitted. + :vartype provisioning_error: ~azure.mgmt.containerservice.models.ErrorDetail + """ + + provisioning_error: Optional["_models.ErrorDetail"] = rest_field(name="provisioningError", visibility=["read"]) + """The error details information of the managed cluster. Preserves the detailed info of failure. + If there was no error, this field is omitted.""" + + +class ManagedClusterStorageProfile(_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.models.ManagedClusterStorageProfileDiskCSIDriver + :ivar file_csi_driver: AzureFile CSI Driver settings for the storage profile. + :vartype file_csi_driver: + ~azure.mgmt.containerservice.models.ManagedClusterStorageProfileFileCSIDriver + :ivar snapshot_controller: Snapshot Controller settings for the storage profile. + :vartype snapshot_controller: + ~azure.mgmt.containerservice.models.ManagedClusterStorageProfileSnapshotController + :ivar blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. + :vartype blob_csi_driver: + ~azure.mgmt.containerservice.models.ManagedClusterStorageProfileBlobCSIDriver + """ + + disk_csi_driver: Optional["_models.ManagedClusterStorageProfileDiskCSIDriver"] = rest_field( + name="diskCSIDriver", visibility=["read", "create", "update", "delete", "query"] + ) + """AzureDisk CSI Driver settings for the storage profile.""" + file_csi_driver: Optional["_models.ManagedClusterStorageProfileFileCSIDriver"] = rest_field( + name="fileCSIDriver", visibility=["read", "create", "update", "delete", "query"] + ) + """AzureFile CSI Driver settings for the storage profile.""" + snapshot_controller: Optional["_models.ManagedClusterStorageProfileSnapshotController"] = rest_field( + name="snapshotController", visibility=["read", "create", "update", "delete", "query"] + ) + """Snapshot Controller settings for the storage profile.""" + blob_csi_driver: Optional["_models.ManagedClusterStorageProfileBlobCSIDriver"] = rest_field( + name="blobCSIDriver", visibility=["read", "create", "update", "delete", "query"] + ) + """AzureBlob CSI Driver settings for the storage profile.""" + + @overload + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterStorageProfileBlobCSIDriver(_Model): # pylint: disable=name-too-long + """AzureBlob CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureBlob CSI Driver. The default value is false. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable AzureBlob CSI Driver. The default value is false.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterStorageProfileDiskCSIDriver(_Model): # pylint: disable=name-too-long + """AzureDisk CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureDisk CSI Driver. The default value is true. + :vartype enabled: bool + :ivar version: The version of AzureDisk CSI Driver. The default value is v1. + :vartype version: str + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable AzureDisk CSI Driver. The default value is true.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of AzureDisk CSI Driver. The default value is v1.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterStorageProfileFileCSIDriver(_Model): # pylint: disable=name-too-long + """AzureFile CSI Driver settings for the storage profile. + + :ivar enabled: Whether to enable AzureFile CSI Driver. The default value is true. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable AzureFile CSI Driver. The default value is true.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterStorageProfileSnapshotController(_Model): # pylint: disable=name-too-long + """Snapshot Controller settings for the storage profile. + + :ivar enabled: Whether to enable Snapshot Controller. The default value is true. + :vartype enabled: bool + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable Snapshot Controller. The default value is true.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterUpgradeProfile(ProxyResource): + """The list of available upgrades for compute pools. + + :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.models.SystemData + :ivar properties: The properties of the upgrade profile. Required. + :vartype properties: ~azure.mgmt.containerservice.models.ManagedClusterUpgradeProfileProperties + """ + + properties: "_models.ManagedClusterUpgradeProfileProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The properties of the upgrade profile. Required.""" + + __flattened_items = ["control_plane_profile", "agent_pool_profiles"] + + @overload + def __init__( + self, + *, + properties: "_models.ManagedClusterUpgradeProfileProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedClusterUpgradeProfileProperties(_Model): + """Control plane and agent pool upgrade profiles. + + :ivar control_plane_profile: The list of available upgrade versions for the control plane. + Required. + :vartype control_plane_profile: + ~azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfile + :ivar agent_pool_profiles: The list of available upgrade versions for agent pools. Required. + :vartype agent_pool_profiles: + list[~azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfile] + """ + + control_plane_profile: "_models.ManagedClusterPoolUpgradeProfile" = rest_field( + name="controlPlaneProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of available upgrade versions for the control plane. Required.""" + agent_pool_profiles: list["_models.ManagedClusterPoolUpgradeProfile"] = rest_field( + name="agentPoolProfiles", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of available upgrade versions for agent pools. Required.""" + + @overload + def __init__( + self, + *, + control_plane_profile: "_models.ManagedClusterPoolUpgradeProfile", + agent_pool_profiles: list["_models.ManagedClusterPoolUpgradeProfile"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterWindowsProfile(_Model): + """Profile for Windows VMs in the managed cluster. + + :ivar admin_username: Specifies the name of the administrator account.

+ **Restriction:** Cannot end in "."

**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". +

**Minimum-length:** 1 character

**Max-length:** 20 characters. Required. + :vartype admin_username: str + :ivar admin_password: Specifies the password of the administrator account.

+ **Minimum-length:** 8 characters

**Max-length:** 123 characters

**Complexity + requirements:** 3 out of 4 conditions below need to be fulfilled
Has lower characters +
Has upper characters
Has a digit
Has a special character (Regex match [\\W_]) +

**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.models.LicenseType + :ivar enable_csi_proxy: Whether to 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.models.WindowsGmsaProfile + """ + + admin_username: str = rest_field(name="adminUsername", visibility=["read", "create", "update", "delete", "query"]) + """Specifies the name of the administrator account.

**Restriction:** Cannot end in \".\" +

**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\".

**Minimum-length:** 1 character

+ **Max-length:** 20 characters. Required.""" + admin_password: Optional[str] = rest_field( + name="adminPassword", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the password of the administrator account.

**Minimum-length:** 8 characters +

**Max-length:** 123 characters

**Complexity requirements:** 3 out of 4 + conditions below need to be fulfilled
Has lower characters
Has upper characters
+ Has a digit
Has a special character (Regex match [\W_])

**Disallowed values:** + \"abc@123\", \"P@$$w0rd\", \"P@ssw0rd\", \"P@ssword123\", \"Pa$$word\", \"pass@word1\", + \"Password!\", \"Password1\", \"Password22\", \"iloveyou!\".""" + license_type: Optional[Union[str, "_models.LicenseType"]] = rest_field( + name="licenseType", visibility=["read", "create", "update", "delete", "query"] + ) + """The license type to use for Windows VMs. See `Azure Hybrid User Benefits + `_ for more details. Known values are: + \"None\" and \"Windows_Server\".""" + enable_csi_proxy: Optional[bool] = rest_field( + name="enableCSIProxy", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to enable CSI proxy. For more details on CSI proxy, see the `CSI proxy GitHub repo + `_.""" + gmsa_profile: Optional["_models.WindowsGmsaProfile"] = rest_field( + name="gmsaProfile", visibility=["read", "create", "update", "delete", "query"] + ) + """The Windows gMSA Profile in the Managed Cluster.""" + + @overload + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterWorkloadAutoScalerProfile(_Model): + """Workload Auto-scaler profile for the managed cluster. + + :ivar keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler + profile. + :vartype keda: ~azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfileKeda + :ivar vertical_pod_autoscaler: VPA (Vertical Pod Autoscaler) settings for the workload + auto-scaler profile. + :vartype vertical_pod_autoscaler: + ~azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler + """ + + keda: Optional["_models.ManagedClusterWorkloadAutoScalerProfileKeda"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile.""" + vertical_pod_autoscaler: Optional["_models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler"] = ( + rest_field(name="verticalPodAutoscaler", visibility=["read", "create", "update", "delete", "query"]) + ) + """VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile.""" + + @overload + def __init__( + self, + *, + keda: Optional["_models.ManagedClusterWorkloadAutoScalerProfileKeda"] = None, + vertical_pod_autoscaler: Optional[ + "_models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler" + ] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterWorkloadAutoScalerProfileKeda(_Model): # pylint: disable=name-too-long + """KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. + + :ivar enabled: Whether to enable KEDA. Required. + :vartype enabled: bool + """ + + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable KEDA. Required.""" + + @overload + def __init__( + self, + *, + enabled: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler(_Model): # pylint: disable=name-too-long + """VPA (Vertical Pod Autoscaler) settings for the workload auto-scaler profile. + + :ivar enabled: Whether to enable VPA. Default value is false. Required. + :vartype enabled: bool + :ivar addon_autoscaling: Whether VPA add-on is enabled and configured to scale AKS-managed + add-ons. Known values are: "Enabled" and "Disabled". + :vartype addon_autoscaling: str or ~azure.mgmt.containerservice.models.AddonAutoscaling + """ + + enabled: bool = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable VPA. Default value is false. Required.""" + addon_autoscaling: Optional[Union[str, "_models.AddonAutoscaling"]] = rest_field( + name="addonAutoscaling", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether VPA add-on is enabled and configured to scale AKS-managed add-ons. Known values are: + \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + enabled: bool, + addon_autoscaling: Optional[Union[str, "_models.AddonAutoscaling"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedNamespace(Resource): + """Namespace managed by ARM. + + :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.models.SystemData + :ivar properties: Properties of a namespace. + :vartype properties: ~azure.mgmt.containerservice.models.NamespaceProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. + :vartype location: str + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str + """ + + properties: Optional["_models.NamespaceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of a namespace.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: Optional[str] = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.NamespaceProperties"] = None, + tags: Optional[dict[str, str]] = None, + location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedServiceIdentityUserAssignedIdentitiesValue(_Model): # pylint: disable=name-too-long + """User assigned identity properties. + + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal id of user assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client id of user assigned identity.""" + + +class ManualScaleProfile(_Model): + """Specifications on number of machines. + + :ivar size: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', + 'Standard_E16s_v3' or 'Standard_D16s_v5'. + :vartype size: str + :ivar count: Number of nodes. + :vartype count: int + """ + + size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', 'Standard_E16s_v3' + or 'Standard_D16s_v5'.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of nodes.""" + + @overload + def __init__( + self, + *, + size: Optional[str] = None, + count: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MeshMembership(ProxyResource): + """Mesh membership of a managed cluster. + + :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.models.SystemData + :ivar properties: Mesh membership properties of a managed cluster. + :vartype properties: ~azure.mgmt.containerservice.models.MeshMembershipProperties + :ivar managed_by: The fully qualified resource ID of the resource that manages this resource. + Indicates if this resource is managed by another Azure resource. If this is present, complete + mode deployment will not delete the resource if it is removed from the template since it is + managed by another resource. + :vartype managed_by: str + :ivar e_tag: If eTag is provided in the response body, it may also be provided as a header per + the normal etag convention. Entity tags are used for comparing two or more entities from the + same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match + (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + :vartype e_tag: str + """ + + properties: Optional["_models.MeshMembershipProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Mesh membership properties of a managed cluster.""" + managed_by: Optional[str] = rest_field(name="managedBy", visibility=["read", "create", "update"]) + """The fully qualified resource ID of the resource that manages this resource. Indicates if this + resource is managed by another Azure resource. If this is present, complete mode deployment + will not delete the resource if it is removed from the template since it is managed by another + resource.""" + e_tag: Optional[str] = rest_field(name="eTag", visibility=["read"]) + """If eTag is provided in the response body, it may also be provided as a header per the normal + etag convention. Entity tags are used for comparing two or more entities from the same + requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section + 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.MeshMembershipProperties"] = None, + managed_by: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MeshMembershipProperties(_Model): + """Mesh membership properties of a managed cluster. + + :ivar provisioning_state: The current provisioning state of the Mesh Membership. Known values + are: "Canceled", "Creating", "Deleting", "Failed", "Succeeded", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.models.MeshMembershipProvisioningState + :ivar managed_mesh_id: The ARM resource id for the managed mesh member. This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/applinks/{appLinkName}/appLinkMembers/{appLinkMemberName}'. + Visit `https://aka.ms/applink `_ for more information. Required. + :vartype managed_mesh_id: str + """ + + provisioning_state: Optional[Union[str, "_models.MeshMembershipProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The current provisioning state of the Mesh Membership. Known values are: \"Canceled\", + \"Creating\", \"Deleting\", \"Failed\", \"Succeeded\", and \"Updating\".""" + managed_mesh_id: str = rest_field(name="managedMeshID", visibility=["read", "create", "update", "delete", "query"]) + """The ARM resource id for the managed mesh member. This is of the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/applinks/{appLinkName}/appLinkMembers/{appLinkMemberName}'. + Visit `https://aka.ms/applink `_ for more information. Required.""" + + @overload + def __init__( + self, + *, + managed_mesh_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MeshRevision(_Model): + """Holds information on upgrades and compatibility for given major.minor mesh release. + + :ivar revision: The revision of the mesh release. + :vartype revision: str + :ivar upgrades: List of revisions available for upgrade of a specific mesh revision. + :vartype upgrades: list[str] + :ivar compatible_with: List of items this revision of service mesh is compatible with, and + their associated versions. + :vartype compatible_with: list[~azure.mgmt.containerservice.models.CompatibleVersions] + """ + + revision: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The revision of the mesh release.""" + upgrades: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of revisions available for upgrade of a specific mesh revision.""" + compatible_with: Optional[list["_models.CompatibleVersions"]] = rest_field( + name="compatibleWith", visibility=["read", "create", "update", "delete", "query"] + ) + """List of items this revision of service mesh is compatible with, and their associated versions.""" + + @overload + def __init__( + self, + *, + revision: Optional[str] = None, + upgrades: Optional[list[str]] = None, + compatible_with: Optional[list["_models.CompatibleVersions"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MeshRevisionProfile(ProxyResource): + """Mesh revision profile for a mesh. + + :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.models.SystemData + :ivar properties: Mesh revision profile properties for a mesh. + :vartype properties: ~azure.mgmt.containerservice.models.MeshRevisionProfileProperties + """ + + properties: Optional["_models.MeshRevisionProfileProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Mesh revision profile properties for a mesh.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.MeshRevisionProfileProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MeshRevisionProfileProperties(_Model): + """Mesh revision profile properties for a mesh. + + :ivar mesh_revisions: Available mesh revisions. + :vartype mesh_revisions: list[~azure.mgmt.containerservice.models.MeshRevision] + """ + + mesh_revisions: Optional[list["_models.MeshRevision"]] = rest_field( + name="meshRevisions", visibility=["read", "create", "update", "delete", "query"] + ) + """Available mesh revisions.""" + + @overload + def __init__( + self, + *, + mesh_revisions: Optional[list["_models.MeshRevision"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MeshUpgradeProfile(ProxyResource): + """Upgrade profile for given mesh. + + :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.models.SystemData + :ivar properties: Mesh upgrade profile properties for a major.minor release. + :vartype properties: ~azure.mgmt.containerservice.models.MeshUpgradeProfileProperties + """ + + properties: Optional["_models.MeshUpgradeProfileProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Mesh upgrade profile properties for a major.minor release.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.MeshUpgradeProfileProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MeshUpgradeProfileProperties(MeshRevision): + """Mesh upgrade profile properties for a major.minor release. + + :ivar revision: The revision of the mesh release. + :vartype revision: str + :ivar upgrades: List of revisions available for upgrade of a specific mesh revision. + :vartype upgrades: list[str] + :ivar compatible_with: List of items this revision of service mesh is compatible with, and + their associated versions. + :vartype compatible_with: list[~azure.mgmt.containerservice.models.CompatibleVersions] + """ + + @overload + def __init__( + self, + *, + revision: Optional[str] = None, + upgrades: Optional[list[str]] = None, + compatible_with: Optional[list["_models.CompatibleVersions"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NamespaceProperties(_Model): + """Properties of a namespace managed by ARM. + + :ivar provisioning_state: The current provisioning state of the namespace. Known values are: + "Updating", "Deleting", "Creating", "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.models.NamespaceProvisioningState + :ivar labels: The labels of managed namespace. + :vartype labels: dict[str, str] + :ivar annotations: The annotations of managed namespace. + :vartype annotations: dict[str, str] + :ivar portal_fqdn: The special FQDN used by the Azure Portal to access the Managed Cluster. + This FQDN is for use only by the Azure Portal and should not be used by other clients. 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 portal_fqdn: str + :ivar default_resource_quota: The default resource quota enforced upon the namespace. Customers + can have other Kubernetes resource quota objects under the namespace. Resource quotas are + additive; if multiple resource quotas are applied to a given namespace, then the effective + limit will be one such that all quotas on the namespace can be satisfied. + :vartype default_resource_quota: ~azure.mgmt.containerservice.models.ResourceQuota + :ivar default_network_policy: The default network policy enforced upon the namespace. Customers + can have other Kubernetes network policy objects under the namespace. Network policies are + additive; if a policy or policies apply to a given pod for a given direction, the connections + allowed in that direction for the pod is the union of what all applicable policies allow. + :vartype default_network_policy: ~azure.mgmt.containerservice.models.NetworkPolicies + :ivar adoption_policy: Action if Kubernetes namespace with same name already exists. Known + values are: "Never", "IfIdentical", and "Always". + :vartype adoption_policy: str or ~azure.mgmt.containerservice.models.AdoptionPolicy + :ivar delete_policy: Delete options of a namespace. Known values are: "Keep" and "Delete". + :vartype delete_policy: str or ~azure.mgmt.containerservice.models.DeletePolicy + """ + + provisioning_state: Optional[Union[str, "_models.NamespaceProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The current provisioning state of the namespace. Known values are: \"Updating\", \"Deleting\", + \"Creating\", \"Succeeded\", \"Failed\", and \"Canceled\".""" + labels: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The labels of managed namespace.""" + annotations: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The annotations of managed namespace.""" + portal_fqdn: Optional[str] = rest_field(name="portalFqdn", visibility=["read"]) + """The special FQDN used by the Azure Portal to access the Managed Cluster. This FQDN is for use + only by the Azure Portal and should not be used by other clients. 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.""" + default_resource_quota: Optional["_models.ResourceQuota"] = rest_field( + name="defaultResourceQuota", visibility=["read", "create", "update", "delete", "query"] + ) + """The default resource quota enforced upon the namespace. Customers can have other Kubernetes + resource quota objects under the namespace. Resource quotas are additive; if multiple resource + quotas are applied to a given namespace, then the effective limit will be one such that all + quotas on the namespace can be satisfied.""" + default_network_policy: Optional["_models.NetworkPolicies"] = rest_field( + name="defaultNetworkPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """The default network policy enforced upon the namespace. Customers can have other Kubernetes + network policy objects under the namespace. Network policies are additive; if a policy or + policies apply to a given pod for a given direction, the connections allowed in that direction + for the pod is the union of what all applicable policies allow.""" + adoption_policy: Optional[Union[str, "_models.AdoptionPolicy"]] = rest_field( + name="adoptionPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Action if Kubernetes namespace with same name already exists. Known values are: \"Never\", + \"IfIdentical\", and \"Always\".""" + delete_policy: Optional[Union[str, "_models.DeletePolicy"]] = rest_field( + name="deletePolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Delete options of a namespace. Known values are: \"Keep\" and \"Delete\".""" + + @overload + def __init__( + self, + *, + labels: Optional[dict[str, str]] = None, + annotations: Optional[dict[str, str]] = None, + default_resource_quota: Optional["_models.ResourceQuota"] = None, + default_network_policy: Optional["_models.NetworkPolicies"] = None, + adoption_policy: Optional[Union[str, "_models.AdoptionPolicy"]] = None, + delete_policy: Optional[Union[str, "_models.DeletePolicy"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkPolicies(_Model): + """Default network policy of the namespace, specifying ingress and egress rules. + + :ivar ingress: Enum representing different network policy rules. Known values are: "DenyAll", + "AllowAll", and "AllowSameNamespace". + :vartype ingress: str or ~azure.mgmt.containerservice.models.PolicyRule + :ivar egress: Enum representing different network policy rules. Known values are: "DenyAll", + "AllowAll", and "AllowSameNamespace". + :vartype egress: str or ~azure.mgmt.containerservice.models.PolicyRule + """ + + ingress: Optional[Union[str, "_models.PolicyRule"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Enum representing different network policy rules. Known values are: \"DenyAll\", \"AllowAll\", + and \"AllowSameNamespace\".""" + egress: Optional[Union[str, "_models.PolicyRule"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Enum representing different network policy rules. Known values are: \"DenyAll\", \"AllowAll\", + and \"AllowSameNamespace\".""" + + @overload + def __init__( + self, + *, + ingress: Optional[Union[str, "_models.PolicyRule"]] = None, + egress: Optional[Union[str, "_models.PolicyRule"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkProfileForSnapshot(_Model): + """network profile for managed cluster snapshot, these properties are read only. + + :ivar network_plugin: networkPlugin for managed cluster snapshot. Known values are: "azure", + "kubenet", and "none". + :vartype network_plugin: str or ~azure.mgmt.containerservice.models.NetworkPlugin + :ivar network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" + :vartype network_plugin_mode: str or ~azure.mgmt.containerservice.models.NetworkPluginMode + :ivar network_policy: networkPolicy for managed cluster snapshot. Known values are: "none", + "calico", "azure", and "cilium". + :vartype network_policy: str or ~azure.mgmt.containerservice.models.NetworkPolicy + :ivar network_mode: networkMode for managed cluster snapshot. Known values are: "transparent" + and "bridge". + :vartype network_mode: str or ~azure.mgmt.containerservice.models.NetworkMode + :ivar load_balancer_sku: loadBalancerSku for managed cluster snapshot. Known values are: + "standard" and "basic". + :vartype load_balancer_sku: str or ~azure.mgmt.containerservice.models.LoadBalancerSku + """ + + network_plugin: Optional[Union[str, "_models.NetworkPlugin"]] = rest_field( + name="networkPlugin", visibility=["read", "create", "update", "delete", "query"] + ) + """networkPlugin for managed cluster snapshot. Known values are: \"azure\", \"kubenet\", and + \"none\".""" + network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = rest_field( + name="networkPluginMode", visibility=["read", "create", "update", "delete", "query"] + ) + """NetworkPluginMode for managed cluster snapshot. \"overlay\"""" + network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = rest_field( + name="networkPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """networkPolicy for managed cluster snapshot. Known values are: \"none\", \"calico\", \"azure\", + and \"cilium\".""" + network_mode: Optional[Union[str, "_models.NetworkMode"]] = rest_field( + name="networkMode", visibility=["read", "create", "update", "delete", "query"] + ) + """networkMode for managed cluster snapshot. Known values are: \"transparent\" and \"bridge\".""" + load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = rest_field( + name="loadBalancerSku", visibility=["read", "create", "update", "delete", "query"] + ) + """loadBalancerSku for managed cluster snapshot. Known values are: \"standard\" and \"basic\".""" + + @overload + def __init__( + self, + *, + network_plugin: Optional[Union[str, "_models.NetworkPlugin"]] = None, + network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = None, + network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = None, + network_mode: Optional[Union[str, "_models.NetworkMode"]] = None, + load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NodeCustomizationProfile(_Model): + """Settings to determine the node customization used to provision nodes in a pool. + + :ivar node_customization_id: The resource ID of the node customization resource to use. This + can be a version. Omitting the version will use the latest version of the node customization. + :vartype node_customization_id: str + """ + + node_customization_id: Optional[str] = rest_field( + name="nodeCustomizationId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the node customization resource to use. This can be a version. Omitting the + version will use the latest version of the node customization.""" + + @overload + def __init__( + self, + *, + node_customization_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NodeImageVersion(_Model): + """node image version profile for given major.minor.patch release. + + :ivar os: The operating system of the node image. Example: AKSUbuntu. + :vartype os: str + :ivar sku: The SKU or flavor of the node image. Example: 2004gen2containerd. + :vartype sku: str + :ivar version: major.minor.patch version of the node image version release. Example: + 2024.02.02. + :vartype version: str + :ivar full_name: The OS + SKU + version of the node image. Example: + AKSUbuntu-1804gen2containerd-2024.02.02. + :vartype full_name: str + """ + + os: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The operating system of the node image. Example: AKSUbuntu.""" + sku: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The SKU or flavor of the node image. Example: 2004gen2containerd.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """major.minor.patch version of the node image version release. Example: 2024.02.02.""" + full_name: Optional[str] = rest_field(name="fullName", visibility=["read", "create", "update", "delete", "query"]) + """The OS + SKU + version of the node image. Example: AKSUbuntu-1804gen2containerd-2024.02.02.""" + + @overload + def __init__( + self, + *, + os: Optional[str] = None, + sku: Optional[str] = None, + version: Optional[str] = None, + full_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationStatusResult(_Model): + """The current status of an async operation. + + :ivar id: Fully qualified ID for the async operation. + :vartype id: str + :ivar name: Name of the async operation. + :vartype name: str + :ivar status: Operation status. Required. + :vartype status: str + :ivar percent_complete: Percent of the operation that is complete. + :vartype percent_complete: float + :ivar start_time: The start time of the operation. + :vartype start_time: ~datetime.datetime + :ivar end_time: The end time of the operation. + :vartype end_time: ~datetime.datetime + :ivar operations: The operations list. + :vartype operations: list[~azure.mgmt.containerservice.models.OperationStatusResult] + :ivar error: If present, details of the operation error. + :vartype error: ~azure.mgmt.containerservice.models.ErrorDetail + :ivar resource_id: Fully qualified ID of the resource against which the original async + operation was started. + :vartype resource_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Fully qualified ID for the async operation.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Name of the async operation.""" + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Operation status. Required.""" + percent_complete: Optional[float] = rest_field( + name="percentComplete", visibility=["read", "create", "update", "delete", "query"] + ) + """Percent of the operation that is complete.""" + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start time of the operation.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end time of the operation.""" + operations: Optional[list["_models.OperationStatusResult"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The operations list.""" + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If present, details of the operation error.""" + resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"]) + """Fully qualified ID of the resource against which the original async operation was started.""" + + @overload + def __init__( + self, + *, + status: str, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + percent_complete: Optional[float] = None, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + operations: Optional[list["_models.OperationStatusResult"]] = None, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OperationValue(_Model): + """Describes the properties of a Operation value. + + :ivar origin: The origin of the operation. + :vartype origin: str + :ivar name: The name of the operation. + :vartype name: str + :ivar display: Describes the properties of a Operation Value Display. + :vartype display: ~azure.mgmt.containerservice.models.OperationValueDisplay + """ + + origin: Optional[str] = rest_field(visibility=["read"]) + """The origin of the operation.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation.""" + display: Optional["_models.OperationValueDisplay"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Describes the properties of a Operation Value Display.""" + + __flattened_items = ["operation", "resource", "description", "provider"] + + @overload + def __init__( + self, + *, + display: Optional["_models.OperationValueDisplay"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.display is None: + return None + return getattr(self.display, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.display is None: + self.display = self._attr_to_rest_field["display"]._class_type() + setattr(self.display, key, value) + else: + super().__setattr__(key, value) + + +class OperationValueDisplay(_Model): + """Describes the properties of a Operation Value Display. + + :ivar operation: The display name of the operation. + :vartype operation: str + :ivar resource: The display name of the resource the operation applies to. + :vartype resource: str + :ivar description: The description of the operation. + :vartype description: str + :ivar provider: The resource provider for the operation. + :vartype provider: str + """ + + operation: Optional[str] = rest_field(visibility=["read"]) + """The display name of the operation.""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The display name of the resource the operation applies to.""" + description: Optional[str] = rest_field(visibility=["read"]) + """The description of the operation.""" + provider: Optional[str] = rest_field(visibility=["read"]) + """The resource provider for the operation.""" + + +class OutboundEnvironmentEndpoint(_Model): + """Egress endpoints which AKS agent nodes connect to for common purpose. + + :ivar category: The category of endpoints accessed by the AKS agent node, e.g. + azure-resource-management, apiserver, etc. + :vartype category: str + :ivar endpoints: The endpoints that AKS agent nodes connect to. + :vartype endpoints: list[~azure.mgmt.containerservice.models.EndpointDependency] + """ + + category: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, + apiserver, etc.""" + endpoints: Optional[list["_models.EndpointDependency"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The endpoints that AKS agent nodes connect to.""" + + @overload + def __init__( + self, + *, + category: Optional[str] = None, + endpoints: Optional[list["_models.EndpointDependency"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PortRange(_Model): + """The port range. + + :ivar port_start: The minimum port that is included in the range. It should be ranged from 1 to + 65535, and be less than or equal to portEnd. + :vartype port_start: int + :ivar port_end: The maximum port that is included in the range. It should be ranged from 1 to + 65535, and be greater than or equal to portStart. + :vartype port_end: int + :ivar protocol: The network protocol of the port. Known values are: "TCP" and "UDP". + :vartype protocol: str or ~azure.mgmt.containerservice.models.Protocol + """ + + port_start: Optional[int] = rest_field(name="portStart", visibility=["read", "create", "update", "delete", "query"]) + """The minimum port that is included in the range. It should be ranged from 1 to 65535, and be + less than or equal to portEnd.""" + port_end: Optional[int] = rest_field(name="portEnd", visibility=["read", "create", "update", "delete", "query"]) + """The maximum port that is included in the range. It should be ranged from 1 to 65535, and be + greater than or equal to portStart.""" + protocol: Optional[Union[str, "_models.Protocol"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The network protocol of the port. Known values are: \"TCP\" and \"UDP\".""" + + @overload + def __init__( + self, + *, + port_start: Optional[int] = None, + port_end: Optional[int] = None, + protocol: Optional[Union[str, "_models.Protocol"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PowerState(_Model): + """Describes the Power State of the cluster. + + :ivar code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and + "Stopped". + :vartype code: str or ~azure.mgmt.containerservice.models.Code + """ + + code: Optional[Union[str, "_models.Code"]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Tells whether the cluster is Running or Stopped. Known values are: \"Running\" and \"Stopped\".""" + + @overload + def __init__( + self, + *, + code: Optional[Union[str, "_models.Code"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrivateEndpoint(_Model): + """Private endpoint which a connection belongs to. + + :ivar id: The resource ID of the private endpoint. + :vartype id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource ID of the private endpoint.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection. + + :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.models.SystemData + :ivar properties: The properties of a private endpoint connection. + :vartype properties: ~azure.mgmt.containerservice.models.PrivateEndpointConnectionProperties + """ + + properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The properties of a private endpoint connection.""" + + __flattened_items = ["provisioning_state", "private_endpoint", "private_link_service_connection_state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.PrivateEndpointConnectionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class PrivateEndpointConnectionListResult(_Model): + """A list of private endpoint connections. + + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.models.PrivateEndpointConnection] + """ + + value: Optional[list["_models.PrivateEndpointConnection"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The collection value.""" + + @overload + def __init__( + self, + *, + value: Optional[list["_models.PrivateEndpointConnection"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrivateEndpointConnectionProperties(_Model): + """Properties of a private endpoint connection. + + :ivar provisioning_state: The current provisioning state. Known values are: "Canceled", + "Creating", "Deleting", "Failed", and "Succeeded". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.models.PrivateEndpointConnectionProvisioningState + :ivar private_endpoint: The resource of private endpoint. + :vartype private_endpoint: ~azure.mgmt.containerservice.models.PrivateEndpoint + :ivar private_link_service_connection_state: A collection of information about the state of the + connection between service consumer and provider. Required. + :vartype private_link_service_connection_state: + ~azure.mgmt.containerservice.models.PrivateLinkServiceConnectionState + """ + + provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The current provisioning state. Known values are: \"Canceled\", \"Creating\", \"Deleting\", + \"Failed\", and \"Succeeded\".""" + private_endpoint: Optional["_models.PrivateEndpoint"] = rest_field( + name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource of private endpoint.""" + private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState" = rest_field( + name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"] + ) + """A collection of information about the state of the connection between service consumer and + provider. Required.""" + + @overload + def __init__( + self, + *, + private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState", + private_endpoint: Optional["_models.PrivateEndpoint"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrivateLinkResource(_Model): + """A private link resource. + + :ivar id: The ID of the private link resource. + :vartype id: str + :ivar name: The name of the private link resource. See `naming rules + `_ for more details. + :vartype name: str + :ivar type: The resource type. + :vartype type: str + :ivar group_id: The group ID of the resource. + :vartype group_id: str + :ivar required_members: The RequiredMembers of the resource. + :vartype required_members: list[str] + :ivar private_link_service_id: The private link service ID of the resource, this field is + exposed only to NRP internally. + :vartype private_link_service_id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The ID of the private link resource.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the private link resource. See `naming rules `_ + for more details.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource type.""" + group_id: Optional[str] = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"]) + """The group ID of the resource.""" + required_members: Optional[list[str]] = rest_field( + name="requiredMembers", visibility=["read", "create", "update", "delete", "query"] + ) + """The RequiredMembers of the resource.""" + private_link_service_id: Optional[str] = rest_field(name="privateLinkServiceID", visibility=["read"]) + """The private link service ID of the resource, this field is exposed only to NRP internally.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + group_id: Optional[str] = None, + required_members: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrivateLinkResourcesListResult(_Model): + """A list of private link resources. + + :ivar value: The collection value. + :vartype value: list[~azure.mgmt.containerservice.models.PrivateLinkResource] + """ + + value: Optional[list["_models.PrivateLinkResource"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The collection value.""" + + @overload + def __init__( + self, + *, + value: Optional[list["_models.PrivateLinkResource"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrivateLinkServiceConnectionState(_Model): + """The state of a private link service connection. + + :ivar status: The private link service connection status. Known values are: "Pending", + "Approved", "Rejected", and "Disconnected". + :vartype status: str or ~azure.mgmt.containerservice.models.ConnectionStatus + :ivar description: The private link service connection description. + :vartype description: str + """ + + status: Optional[Union[str, "_models.ConnectionStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The private link service connection status. Known values are: \"Pending\", \"Approved\", + \"Rejected\", and \"Disconnected\".""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The private link service connection description.""" + + @overload + def __init__( + self, + *, + status: Optional[Union[str, "_models.ConnectionStatus"]] = None, + description: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RebalanceLoadBalancersRequestBody(_Model): + """The names of the load balancers to rebalance. If set to empty, all load balancers will be + rebalanced. + + :ivar load_balancer_names: The load balancer names list. + :vartype load_balancer_names: list[str] + """ + + load_balancer_names: Optional[list[str]] = rest_field( + name="loadBalancerNames", visibility=["read", "create", "update", "delete", "query"] + ) + """The load balancer names list.""" + + @overload + def __init__( + self, + *, + load_balancer_names: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RelativeMonthlySchedule(_Model): + """For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last + Friday'. + + :ivar interval_months: Specifies the number of months between each set of occurrences. + Required. + :vartype interval_months: int + :ivar week_index: The week index. Specifies on which week of the month the dayOfWeek applies. + Required. Known values are: "First", "Second", "Third", "Fourth", and "Last". + :vartype week_index: str or ~azure.mgmt.containerservice.models.Type + :ivar day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known + values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". + :vartype day_of_week: str or ~azure.mgmt.containerservice.models.WeekDay + """ + + interval_months: int = rest_field(name="intervalMonths", visibility=["read", "create", "update", "delete", "query"]) + """Specifies the number of months between each set of occurrences. Required.""" + week_index: Union[str, "_models.Type"] = rest_field( + name="weekIndex", visibility=["read", "create", "update", "delete", "query"] + ) + """The week index. Specifies on which week of the month the dayOfWeek applies. Required. Known + values are: \"First\", \"Second\", \"Third\", \"Fourth\", and \"Last\".""" + day_of_week: Union[str, "_models.WeekDay"] = rest_field( + name="dayOfWeek", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies on which day of the week the maintenance occurs. Required. Known values are: + \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", and \"Saturday\".""" + + @overload + def __init__( + self, + *, + interval_months: int, + week_index: Union[str, "_models.Type"], + day_of_week: Union[str, "_models.WeekDay"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResourceQuota(_Model): + """Resource quota for the namespace. + + :ivar cpu_request: CPU request of the namespace in one-thousandth CPU form. See `CPU resource + units + `_ + for more details. + :vartype cpu_request: str + :ivar cpu_limit: CPU limit of the namespace in one-thousandth CPU form. See `CPU resource units + `_ + for more details. + :vartype cpu_limit: str + :ivar memory_request: Memory request of the namespace in the power-of-two equivalents form: Ei, + Pi, Ti, Gi, Mi, Ki. See `Memory resource units + `_ + for more details. + :vartype memory_request: str + :ivar memory_limit: Memory limit of the namespace in the power-of-two equivalents form: Ei, Pi, + Ti, Gi, Mi, Ki. See `Memory resource units + `_ + for more details. + :vartype memory_limit: str + """ + + cpu_request: Optional[str] = rest_field( + name="cpuRequest", visibility=["read", "create", "update", "delete", "query"] + ) + """CPU request of the namespace in one-thousandth CPU form. See `CPU resource units + `_ + for more details.""" + cpu_limit: Optional[str] = rest_field(name="cpuLimit", visibility=["read", "create", "update", "delete", "query"]) + """CPU limit of the namespace in one-thousandth CPU form. See `CPU resource units + `_ + for more details.""" + memory_request: Optional[str] = rest_field( + name="memoryRequest", visibility=["read", "create", "update", "delete", "query"] + ) + """Memory request of the namespace in the power-of-two equivalents form: Ei, Pi, Ti, Gi, Mi, Ki. + See `Memory resource units + `_ + for more details.""" + memory_limit: Optional[str] = rest_field( + name="memoryLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Memory limit of the namespace in the power-of-two equivalents form: Ei, Pi, Ti, Gi, Mi, Ki. See + `Memory resource units + `_ + for more details.""" + + @overload + def __init__( + self, + *, + cpu_request: Optional[str] = None, + cpu_limit: Optional[str] = None, + memory_request: Optional[str] = None, + memory_limit: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResourceReference(_Model): + """A reference to an Azure resource. + + :ivar id: The fully qualified Azure resource id. + :vartype id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The fully qualified Azure resource id.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RunCommandRequest(_Model): + """A run command request. + + :ivar command: The command to run. Required. + :vartype command: str + :ivar context: A base64 encoded zip file containing the files required by the command. + :vartype context: str + :ivar cluster_token: AuthToken issued for AKS AAD Server App. + :vartype cluster_token: str + """ + + command: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The command to run. Required.""" + context: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A base64 encoded zip file containing the files required by the command.""" + cluster_token: Optional[str] = rest_field( + name="clusterToken", visibility=["read", "create", "update", "delete", "query"] + ) + """AuthToken issued for AKS AAD Server App.""" + + @overload + def __init__( + self, + *, + command: str, + context: Optional[str] = None, + cluster_token: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RunCommandResult(_Model): + """run command result. + + :ivar id: The command id. + :vartype id: str + :ivar properties: Properties of command result. + :vartype properties: ~azure.mgmt.containerservice.models.CommandResultProperties + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """The command id.""" + properties: Optional["_models.CommandResultProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of command result.""" + + __flattened_items = ["provisioning_state", "exit_code", "started_at", "finished_at", "logs", "reason"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.CommandResultProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SafeguardsAvailableVersion(ProxyResource): + """Available Safeguards Version. + + :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.models.SystemData + :ivar properties: Whether the version is default or not and support info. Required. + :vartype properties: ~azure.mgmt.containerservice.models.SafeguardsAvailableVersionsProperties + """ + + properties: "_models.SafeguardsAvailableVersionsProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the version is default or not and support info. Required.""" + + @overload + def __init__( + self, + *, + properties: "_models.SafeguardsAvailableVersionsProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SafeguardsAvailableVersionsProperties(_Model): + """Whether the version is default or not and support info. + + :ivar is_default_version: Whether this is the default version. + :vartype is_default_version: bool + :ivar support: Whether the version is preview or stable. Known values are: "Preview" and + "Stable". + :vartype support: str or ~azure.mgmt.containerservice.models.SafeguardsSupport + """ + + is_default_version: Optional[bool] = rest_field(name="isDefaultVersion", visibility=["read"]) + """Whether this is the default version.""" + support: Optional[Union[str, "_models.SafeguardsSupport"]] = rest_field(visibility=["read"]) + """Whether the version is preview or stable. Known values are: \"Preview\" and \"Stable\".""" + + +class ScaleProfile(_Model): + """Specifications on how to scale a VirtualMachines agent pool. + + :ivar manual: Specifications on how to scale the VirtualMachines agent pool to a fixed size. + :vartype manual: list[~azure.mgmt.containerservice.models.ManualScaleProfile] + :ivar autoscale: Specifications on how to auto-scale the VirtualMachines agent pool within a + predefined size range. + :vartype autoscale: ~azure.mgmt.containerservice.models.AutoScaleProfile + """ + + manual: Optional[list["_models.ManualScaleProfile"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifications on how to scale the VirtualMachines agent pool to a fixed size.""" + autoscale: Optional["_models.AutoScaleProfile"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifications on how to auto-scale the VirtualMachines agent pool within a predefined size + range.""" + + @overload + def __init__( + self, + *, + manual: Optional[list["_models.ManualScaleProfile"]] = None, + autoscale: Optional["_models.AutoScaleProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Schedule(_Model): + """One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', + 'absoluteMonthly' or 'relativeMonthly' for your maintenance schedule. + + :ivar daily: For schedules like: 'recur every day' or 'recur every 3 days'. + :vartype daily: ~azure.mgmt.containerservice.models.DailySchedule + :ivar weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + :vartype weekly: ~azure.mgmt.containerservice.models.WeeklySchedule + :ivar absolute_monthly: For schedules like: 'recur every month on the 15th' or 'recur every 3 + months on the 20th'. + :vartype absolute_monthly: ~azure.mgmt.containerservice.models.AbsoluteMonthlySchedule + :ivar relative_monthly: For schedules like: 'recur every month on the first Monday' or 'recur + every 3 months on last Friday'. + :vartype relative_monthly: ~azure.mgmt.containerservice.models.RelativeMonthlySchedule + """ + + daily: Optional["_models.DailySchedule"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """For schedules like: 'recur every day' or 'recur every 3 days'.""" + weekly: Optional["_models.WeeklySchedule"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'.""" + absolute_monthly: Optional["_models.AbsoluteMonthlySchedule"] = rest_field( + name="absoluteMonthly", visibility=["read", "create", "update", "delete", "query"] + ) + """For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'.""" + relative_monthly: Optional["_models.RelativeMonthlySchedule"] = rest_field( + name="relativeMonthly", visibility=["read", "create", "update", "delete", "query"] + ) + """For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last + Friday'.""" + + @overload + def __init__( + self, + *, + daily: Optional["_models.DailySchedule"] = None, + weekly: Optional["_models.WeeklySchedule"] = None, + absolute_monthly: Optional["_models.AbsoluteMonthlySchedule"] = None, + relative_monthly: Optional["_models.RelativeMonthlySchedule"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SchedulerInstanceProfile(_Model): + """The scheduler profile for a single scheduler instance. + + :ivar scheduler_config_mode: The config customization mode for this scheduler instance. Known + values are: "Default" and "ManagedByCRD". + :vartype scheduler_config_mode: str or ~azure.mgmt.containerservice.models.SchedulerConfigMode + """ + + scheduler_config_mode: Optional[Union[str, "_models.SchedulerConfigMode"]] = rest_field( + name="schedulerConfigMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The config customization mode for this scheduler instance. Known values are: \"Default\" and + \"ManagedByCRD\".""" + + @overload + def __init__( + self, + *, + scheduler_config_mode: Optional[Union[str, "_models.SchedulerConfigMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SchedulerProfile(_Model): + """The pod scheduler profile for the cluster. + + :ivar scheduler_instance_profiles: Mapping of each scheduler instance to its profile. + :vartype scheduler_instance_profiles: + ~azure.mgmt.containerservice.models.SchedulerProfileSchedulerInstanceProfiles + """ + + scheduler_instance_profiles: Optional["_models.SchedulerProfileSchedulerInstanceProfiles"] = rest_field( + name="schedulerInstanceProfiles", visibility=["read", "create", "update", "delete", "query"] + ) + """Mapping of each scheduler instance to its profile.""" + + @overload + def __init__( + self, + *, + scheduler_instance_profiles: Optional["_models.SchedulerProfileSchedulerInstanceProfiles"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SchedulerProfileSchedulerInstanceProfiles(_Model): # pylint: disable=name-too-long + """Mapping of each scheduler instance to its profile. + + :ivar upstream: The scheduler profile for the upstream scheduler instance. + :vartype upstream: ~azure.mgmt.containerservice.models.SchedulerInstanceProfile + """ + + upstream: Optional["_models.SchedulerInstanceProfile"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The scheduler profile for the upstream scheduler instance.""" + + @overload + def __init__( + self, + *, + upstream: Optional["_models.SchedulerInstanceProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServiceMeshProfile(_Model): + """Service mesh profile for a managed cluster. + + :ivar mode: Mode of the service mesh. Required. Known values are: "Istio" and "Disabled". + :vartype mode: str or ~azure.mgmt.containerservice.models.ServiceMeshMode + :ivar istio: Istio service mesh configuration. + :vartype istio: ~azure.mgmt.containerservice.models.IstioServiceMesh + """ + + mode: Union[str, "_models.ServiceMeshMode"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Mode of the service mesh. Required. Known values are: \"Istio\" and \"Disabled\".""" + istio: Optional["_models.IstioServiceMesh"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Istio service mesh configuration.""" + + @overload + def __init__( + self, + *, + mode: Union[str, "_models.ServiceMeshMode"], + istio: Optional["_models.IstioServiceMesh"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Snapshot(TrackedResource): + """A node pool snapshot resource. + + :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.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 properties: Properties of a snapshot. + :vartype properties: ~azure.mgmt.containerservice.models.SnapshotProperties + """ + + properties: Optional["_models.SnapshotProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties of a snapshot.""" + + __flattened_items = [ + "creation_data", + "snapshot_type", + "kubernetes_version", + "node_image_version", + "os_type", + "os_sku", + "vm_size", + "enable_fips", + ] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.SnapshotProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SnapshotProperties(_Model): + """Properties used to configure a node pool snapshot. + + :ivar creation_data: CreationData to be used to specify the source agent pool resource ID to + create this snapshot. + :vartype creation_data: ~azure.mgmt.containerservice.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.models.SnapshotType + :ivar kubernetes_version: The version of Kubernetes. + :vartype kubernetes_version: str + :ivar node_image_version: The version of node image. + :vartype node_image_version: str + :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and + "Windows". + :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType + :ivar os_sku: Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is + Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= + 1.25 if OSType is Windows. Known values are: "Ubuntu", "AzureLinux", "AzureLinux3", "Mariner", + "Flatcar", "CBLMariner", "Windows2019", "Windows2022", "Ubuntu2204", "Windows2025", + "WindowsAnnual", and "Ubuntu2404". + :vartype os_sku: str or ~azure.mgmt.containerservice.models.OSSKU + :ivar vm_size: The size of the VM. + :vartype vm_size: str + :ivar enable_fips: Whether to use a FIPS-enabled OS. + :vartype enable_fips: bool + """ + + creation_data: Optional["_models.CreationData"] = rest_field( + name="creationData", visibility=["read", "create", "update", "delete", "query"] + ) + """CreationData to be used to specify the source agent pool resource ID to create this snapshot.""" + snapshot_type: Optional[Union[str, "_models.SnapshotType"]] = rest_field( + name="snapshotType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of a snapshot. The default is NodePool. Known values are: \"NodePool\" and + \"ManagedCluster\".""" + kubernetes_version: Optional[str] = rest_field(name="kubernetesVersion", visibility=["read"]) + """The version of Kubernetes.""" + node_image_version: Optional[str] = rest_field(name="nodeImageVersion", visibility=["read"]) + """The version of node image.""" + os_type: Optional[Union[str, "_models.OSType"]] = rest_field(name="osType", visibility=["read"]) + """The operating system type. The default is Linux. Known values are: \"Linux\" and \"Windows\".""" + os_sku: Optional[Union[str, "_models.OSSKU"]] = rest_field(name="osSku", visibility=["read"]) + """Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The + default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType + is Windows. Known values are: \"Ubuntu\", \"AzureLinux\", \"AzureLinux3\", \"Mariner\", + \"Flatcar\", \"CBLMariner\", \"Windows2019\", \"Windows2022\", \"Ubuntu2204\", \"Windows2025\", + \"WindowsAnnual\", and \"Ubuntu2404\".""" + vm_size: Optional[str] = rest_field(name="vmSize", visibility=["read"]) + """The size of the VM.""" + enable_fips: Optional[bool] = rest_field(name="enableFIPS", visibility=["read"]) + """Whether to use a FIPS-enabled OS.""" + + @overload + def __init__( + self, + *, + creation_data: Optional["_models.CreationData"] = None, + snapshot_type: Optional[Union[str, "_models.SnapshotType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SysctlConfig(_Model): + """Sysctl settings for Linux agent nodes. + + :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. + :vartype net_core_somaxconn: int + :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. + :vartype net_core_netdev_max_backlog: int + :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. + :vartype net_core_rmem_default: int + :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. + :vartype net_core_rmem_max: int + :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. + :vartype net_core_wmem_default: int + :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. + :vartype net_core_wmem_max: int + :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. + :vartype net_core_optmem_max: int + :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. + :vartype net_ipv4_tcp_max_syn_backlog: int + :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. + :vartype net_ipv4_tcp_max_tw_buckets: int + :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. + :vartype net_ipv4_tcp_fin_timeout: int + :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. + :vartype net_ipv4_tcp_keepalive_time: int + :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. + :vartype net_ipv4_tcp_keepalive_probes: int + :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. + :vartype net_ipv4_tcpkeepalive_intvl: int + :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. + :vartype net_ipv4_tcp_tw_reuse: bool + :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. + :vartype net_ipv4_ip_local_port_range: str + :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. + :vartype net_ipv4_neigh_default_gc_thresh1: int + :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. + :vartype net_ipv4_neigh_default_gc_thresh2: int + :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. + :vartype net_ipv4_neigh_default_gc_thresh3: int + :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. + :vartype net_netfilter_nf_conntrack_max: int + :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. + :vartype net_netfilter_nf_conntrack_buckets: int + :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. + :vartype fs_inotify_max_user_watches: int + :ivar fs_file_max: Sysctl setting fs.file-max. + :vartype fs_file_max: int + :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. + :vartype fs_aio_max_nr: int + :ivar fs_nr_open: Sysctl setting fs.nr_open. + :vartype fs_nr_open: int + :ivar kernel_threads_max: Sysctl setting kernel.threads-max. + :vartype kernel_threads_max: int + :ivar vm_max_map_count: Sysctl setting vm.max_map_count. + :vartype vm_max_map_count: int + :ivar vm_swappiness: Sysctl setting vm.swappiness. + :vartype vm_swappiness: int + :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. + :vartype vm_vfs_cache_pressure: int + """ + + net_core_somaxconn: Optional[int] = rest_field( + name="netCoreSomaxconn", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.core.somaxconn.""" + net_core_netdev_max_backlog: Optional[int] = rest_field( + name="netCoreNetdevMaxBacklog", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.core.netdev_max_backlog.""" + net_core_rmem_default: Optional[int] = rest_field( + name="netCoreRmemDefault", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.core.rmem_default.""" + net_core_rmem_max: Optional[int] = rest_field( + name="netCoreRmemMax", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.core.rmem_max.""" + net_core_wmem_default: Optional[int] = rest_field( + name="netCoreWmemDefault", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.core.wmem_default.""" + net_core_wmem_max: Optional[int] = rest_field( + name="netCoreWmemMax", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.core.wmem_max.""" + net_core_optmem_max: Optional[int] = rest_field( + name="netCoreOptmemMax", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.core.optmem_max.""" + net_ipv4_tcp_max_syn_backlog: Optional[int] = rest_field( + name="netIpv4TcpMaxSynBacklog", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.tcp_max_syn_backlog.""" + net_ipv4_tcp_max_tw_buckets: Optional[int] = rest_field( + name="netIpv4TcpMaxTwBuckets", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.tcp_max_tw_buckets.""" + net_ipv4_tcp_fin_timeout: Optional[int] = rest_field( + name="netIpv4TcpFinTimeout", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.tcp_fin_timeout.""" + net_ipv4_tcp_keepalive_time: Optional[int] = rest_field( + name="netIpv4TcpKeepaliveTime", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.tcp_keepalive_time.""" + net_ipv4_tcp_keepalive_probes: Optional[int] = rest_field( + name="netIpv4TcpKeepaliveProbes", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.tcp_keepalive_probes.""" + net_ipv4_tcpkeepalive_intvl: Optional[int] = rest_field( + name="netIpv4TcpkeepaliveIntvl", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.tcp_keepalive_intvl.""" + net_ipv4_tcp_tw_reuse: Optional[bool] = rest_field( + name="netIpv4TcpTwReuse", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.tcp_tw_reuse.""" + net_ipv4_ip_local_port_range: Optional[str] = rest_field( + name="netIpv4IpLocalPortRange", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.ip_local_port_range.""" + net_ipv4_neigh_default_gc_thresh1: Optional[int] = rest_field( + name="netIpv4NeighDefaultGcThresh1", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.neigh.default.gc_thresh1.""" + net_ipv4_neigh_default_gc_thresh2: Optional[int] = rest_field( + name="netIpv4NeighDefaultGcThresh2", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.neigh.default.gc_thresh2.""" + net_ipv4_neigh_default_gc_thresh3: Optional[int] = rest_field( + name="netIpv4NeighDefaultGcThresh3", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.ipv4.neigh.default.gc_thresh3.""" + net_netfilter_nf_conntrack_max: Optional[int] = rest_field( + name="netNetfilterNfConntrackMax", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.netfilter.nf_conntrack_max.""" + net_netfilter_nf_conntrack_buckets: Optional[int] = rest_field( + name="netNetfilterNfConntrackBuckets", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting net.netfilter.nf_conntrack_buckets.""" + fs_inotify_max_user_watches: Optional[int] = rest_field( + name="fsInotifyMaxUserWatches", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting fs.inotify.max_user_watches.""" + fs_file_max: Optional[int] = rest_field( + name="fsFileMax", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting fs.file-max.""" + fs_aio_max_nr: Optional[int] = rest_field( + name="fsAioMaxNr", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting fs.aio-max-nr.""" + fs_nr_open: Optional[int] = rest_field(name="fsNrOpen", visibility=["read", "create", "update", "delete", "query"]) + """Sysctl setting fs.nr_open.""" + kernel_threads_max: Optional[int] = rest_field( + name="kernelThreadsMax", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting kernel.threads-max.""" + vm_max_map_count: Optional[int] = rest_field( + name="vmMaxMapCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting vm.max_map_count.""" + vm_swappiness: Optional[int] = rest_field( + name="vmSwappiness", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting vm.swappiness.""" + vm_vfs_cache_pressure: Optional[int] = rest_field( + name="vmVfsCachePressure", visibility=["read", "create", "update", "delete", "query"] + ) + """Sysctl setting vm.vfs_cache_pressure.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + net_core_somaxconn: Optional[int] = None, + net_core_netdev_max_backlog: Optional[int] = None, + net_core_rmem_default: Optional[int] = None, + net_core_rmem_max: Optional[int] = None, + net_core_wmem_default: Optional[int] = None, + net_core_wmem_max: Optional[int] = None, + net_core_optmem_max: Optional[int] = None, + net_ipv4_tcp_max_syn_backlog: Optional[int] = None, + net_ipv4_tcp_max_tw_buckets: Optional[int] = None, + net_ipv4_tcp_fin_timeout: Optional[int] = None, + net_ipv4_tcp_keepalive_time: Optional[int] = None, + net_ipv4_tcp_keepalive_probes: Optional[int] = None, + net_ipv4_tcpkeepalive_intvl: Optional[int] = None, + net_ipv4_tcp_tw_reuse: Optional[bool] = None, + net_ipv4_ip_local_port_range: Optional[str] = None, + net_ipv4_neigh_default_gc_thresh1: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh2: Optional[int] = None, + net_ipv4_neigh_default_gc_thresh3: Optional[int] = None, + net_netfilter_nf_conntrack_max: Optional[int] = None, + net_netfilter_nf_conntrack_buckets: Optional[int] = None, + fs_inotify_max_user_watches: Optional[int] = None, + fs_file_max: Optional[int] = None, + fs_aio_max_nr: Optional[int] = None, + fs_nr_open: Optional[int] = None, + kernel_threads_max: Optional[int] = None, + vm_max_map_count: Optional[int] = None, + vm_swappiness: Optional[int] = None, + vm_vfs_cache_pressure: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemData(_Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.containerservice.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.containerservice.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TagsObject(_Model): + """Tags object for patch operations. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TimeInWeek(_Model): + """Time in a week. + + :ivar day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", and "Saturday". + :vartype day: str or ~azure.mgmt.containerservice.models.WeekDay + :ivar hour_slots: A list of hours in the day used to identify a time range. Each integer hour + represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). + 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - + 02:00 UTC time range. + :vartype hour_slots: list[int] + """ + + day: Optional[Union[str, "_models.WeekDay"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The day of the week. Known values are: \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", + \"Thursday\", \"Friday\", and \"Saturday\".""" + hour_slots: Optional[list[int]] = rest_field( + name="hourSlots", visibility=["read", "create", "update", "delete", "query"] + ) + """A list of hours in the day used to identify a time range. Each integer hour represents a time + range beginning at 0m after the hour ending at the next hour (non-inclusive). 0 corresponds to + 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - 02:00 UTC time + range.""" + + @overload + def __init__( + self, + *, + day: Optional[Union[str, "_models.WeekDay"]] = None, + hour_slots: Optional[list[int]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TimeSpan(_Model): + """A time range. For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. + + :ivar start: The start of a time span. + :vartype start: ~datetime.datetime + :ivar end: The end of a time span. + :vartype end: ~datetime.datetime + """ + + start: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The start of a time span.""" + end: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The end of a time span.""" + + @overload + def __init__( + self, + *, + start: Optional[datetime.datetime] = None, + end: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TrustedAccessRole(_Model): + """Trusted access role definition. + + :ivar source_resource_type: Resource type of Azure resource. + :vartype source_resource_type: str + :ivar name: Name of role, name is unique under a source resource type. + :vartype name: str + :ivar rules: List of rules for the role. This maps to 'rules' property of `Kubernetes Cluster + Role + `_. + :vartype rules: list[~azure.mgmt.containerservice.models.TrustedAccessRoleRule] + """ + + source_resource_type: Optional[str] = rest_field(name="sourceResourceType", visibility=["read"]) + """Resource type of Azure resource.""" + name: Optional[str] = rest_field(visibility=["read"]) + """Name of role, name is unique under a source resource type.""" + rules: Optional[list["_models.TrustedAccessRoleRule"]] = rest_field(visibility=["read"]) + """List of rules for the role. This maps to 'rules' property of `Kubernetes Cluster Role + `_.""" + + +class TrustedAccessRoleBinding(ProxyResource): + """Defines binding between a resource and role. + + :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.models.SystemData + :ivar properties: Properties for trusted access role binding. Required. + :vartype properties: ~azure.mgmt.containerservice.models.TrustedAccessRoleBindingProperties + """ + + properties: "_models.TrustedAccessRoleBindingProperties" = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Properties for trusted access role binding. Required.""" + + __flattened_items = ["provisioning_state", "source_resource_id", "roles"] + + @overload + def __init__( + self, + *, + properties: "_models.TrustedAccessRoleBindingProperties", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class TrustedAccessRoleBindingProperties(_Model): + """Properties for trusted access role binding. + + :ivar provisioning_state: The current provisioning state of trusted access role binding. Known + values are: "Canceled", "Deleting", "Failed", "Succeeded", and "Updating". + :vartype provisioning_state: str or + ~azure.mgmt.containerservice.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] + """ + + provisioning_state: Optional[Union[str, "_models.TrustedAccessRoleBindingProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The current provisioning state of trusted access role binding. Known values are: \"Canceled\", + \"Deleting\", \"Failed\", \"Succeeded\", and \"Updating\".""" + source_resource_id: str = rest_field( + name="sourceResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The ARM resource ID of source resource that trusted access is configured for. Required.""" + roles: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A list of roles to bind, each item is a resource type qualified role name. For example: + 'Microsoft.MachineLearningServices/workspaces/reader'. Required.""" + + @overload + def __init__( + self, + *, + source_resource_id: str, + roles: list[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TrustedAccessRoleRule(_Model): + """Rule for trusted access role. + + :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] + """ + + verbs: Optional[list[str]] = rest_field(visibility=["read"]) + """List of allowed verbs.""" + api_groups: Optional[list[str]] = rest_field(name="apiGroups", visibility=["read"]) + """List of allowed apiGroups.""" + resources: Optional[list[str]] = rest_field(visibility=["read"]) + """List of allowed resources.""" + resource_names: Optional[list[str]] = rest_field(name="resourceNames", visibility=["read"]) + """List of allowed names.""" + non_resource_ur_ls: Optional[list[str]] = rest_field(name="nonResourceURLs", visibility=["read"]) + """List of allowed nonResourceURLs.""" + + +class UpgradeOverrideSettings(_Model): + """Settings for overrides when upgrading a cluster. + + :ivar force_upgrade: Whether to force upgrade the cluster. Note that this option instructs + upgrade operation to bypass upgrade protections such as checking for deprecated API usage. + Enable this option only with caution. + :vartype force_upgrade: bool + :ivar until: Until when the overrides are effective. Note that this only matches the start time + of an upgrade, and the effectiveness won't change once an upgrade starts even if the ``until`` + expires as upgrade proceeds. This field is not set by default. It must be set for the overrides + to take effect. + :vartype until: ~datetime.datetime + """ + + force_upgrade: Optional[bool] = rest_field( + name="forceUpgrade", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to force upgrade the cluster. Note that this option instructs upgrade operation to + bypass upgrade protections such as checking for deprecated API usage. Enable this option only + with caution.""" + until: Optional[datetime.datetime] = rest_field( + visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Until when the overrides are effective. Note that this only matches the start time of an + upgrade, and the effectiveness won't change once an upgrade starts even if the ``until`` + expires as upgrade proceeds. This field is not set by default. It must be set for the overrides + to take effect.""" + + @overload + def __init__( + self, + *, + force_upgrade: Optional[bool] = None, + until: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VirtualMachineNodes(_Model): + """Current status on a group of nodes of the same vm size. + + :ivar size: The VM size of the agents used to host this group of nodes. + :vartype size: str + :ivar count: Number of nodes. + :vartype count: int + """ + + size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The VM size of the agents used to host this group of nodes.""" + count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Number of nodes.""" + + @overload + def __init__( + self, + *, + size: Optional[str] = None, + count: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VirtualMachinesProfile(_Model): + """Specifications on VirtualMachines agent pool. + + :ivar scale: Specifications on how to scale a VirtualMachines agent pool. + :vartype scale: ~azure.mgmt.containerservice.models.ScaleProfile + """ + + scale: Optional["_models.ScaleProfile"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specifications on how to scale a VirtualMachines agent pool.""" + + @overload + def __init__( + self, + *, + scale: Optional["_models.ScaleProfile"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class WeeklySchedule(_Model): + """For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. + + :ivar interval_weeks: Specifies the number of weeks between each set of occurrences. Required. + :vartype interval_weeks: int + :ivar day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known + values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". + :vartype day_of_week: str or ~azure.mgmt.containerservice.models.WeekDay + """ + + interval_weeks: int = rest_field(name="intervalWeeks", visibility=["read", "create", "update", "delete", "query"]) + """Specifies the number of weeks between each set of occurrences. Required.""" + day_of_week: Union[str, "_models.WeekDay"] = rest_field( + name="dayOfWeek", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies on which day of the week the maintenance occurs. Required. Known values are: + \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", and \"Saturday\".""" + + @overload + def __init__( + self, + *, + interval_weeks: int, + day_of_week: Union[str, "_models.WeekDay"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class WindowsGmsaProfile(_Model): + """Windows gMSA Profile in the managed cluster. + + :ivar enabled: Whether to enable Windows gMSA. Specifies whether to enable Windows gMSA in the + managed cluster. + :vartype enabled: bool + :ivar dns_server: Specifies the DNS server for Windows gMSA.

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.

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 + """ + + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether to enable Windows gMSA. Specifies whether to enable Windows gMSA in the managed + cluster.""" + dns_server: Optional[str] = rest_field(name="dnsServer", visibility=["read", "create", "update", "delete", "query"]) + """Specifies the DNS server for Windows gMSA.

Set it to empty if you have configured the + DNS server in the vnet which is used to create the managed cluster.""" + root_domain_name: Optional[str] = rest_field( + name="rootDomainName", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the root domain name for Windows gMSA.

Set it to empty if you have + configured the DNS server in the vnet which is used to create the managed cluster.""" + + @overload + def __init__( + self, + *, + enabled: Optional[bool] = None, + dns_server: Optional[str] = None, + root_domain_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_models_py3.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_models_py3.py deleted file mode 100644 index 09122c57ae1c..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_models_py3.py +++ /dev/null @@ -1,13375 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from collections.abc import MutableMapping -import datetime -from typing import Any, Optional, TYPE_CHECKING, Union - -from .._utils import serialization as _serialization - -if TYPE_CHECKING: - from .. import models as _models -JSON = MutableMapping[str, Any] - - -class AbsoluteMonthlySchedule(_serialization.Model): - """For schedules like: 'recur every month on the 15th' or 'recur every 3 months on the 20th'. - - All required parameters must be populated in order to send to server. - - :ivar interval_months: Specifies the number of months between each set of occurrences. - Required. - :vartype interval_months: int - :ivar day_of_month: The date of the month. Required. - :vartype day_of_month: int - """ - - _validation = { - "interval_months": {"required": True, "maximum": 6, "minimum": 1}, - "day_of_month": {"required": True, "maximum": 31, "minimum": 1}, - } - - _attribute_map = { - "interval_months": {"key": "intervalMonths", "type": "int"}, - "day_of_month": {"key": "dayOfMonth", "type": "int"}, - } - - def __init__(self, *, interval_months: int, day_of_month: int, **kwargs: Any) -> None: - """ - :keyword interval_months: Specifies the number of months between each set of occurrences. - Required. - :paramtype interval_months: int - :keyword day_of_month: The date of the month. Required. - :paramtype day_of_month: int - """ - super().__init__(**kwargs) - self.interval_months = interval_months - self.day_of_month = day_of_month - - -class AdvancedNetworking(_serialization.Model): - """Advanced Networking profile for enabling observability and security feature suite on a cluster. - For more information see aka.ms/aksadvancednetworking. - - :ivar enabled: Indicates the enablement of Advanced Networking functionalities of observability - and security on AKS clusters. When this is set to true, all observability and security features - will be set to enabled unless explicitly disabled. If not specified, the default is false. - :vartype enabled: bool - :ivar observability: Observability profile to enable advanced network metrics and flow logs - with historical contexts. - :vartype observability: ~azure.mgmt.containerservice.models.AdvancedNetworkingObservability - :ivar security: Security profile to enable security features on cilium-based cluster. - :vartype security: ~azure.mgmt.containerservice.models.AdvancedNetworkingSecurity - :ivar performance: Profile to enable performance-enhancing features on clusters that use Azure - CNI powered by Cilium. - :vartype performance: ~azure.mgmt.containerservice.models.AdvancedNetworkingPerformance - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "observability": {"key": "observability", "type": "AdvancedNetworkingObservability"}, - "security": {"key": "security", "type": "AdvancedNetworkingSecurity"}, - "performance": {"key": "performance", "type": "AdvancedNetworkingPerformance"}, - } - - def __init__( - self, - *, - enabled: Optional[bool] = None, - observability: Optional["_models.AdvancedNetworkingObservability"] = None, - security: Optional["_models.AdvancedNetworkingSecurity"] = None, - performance: Optional["_models.AdvancedNetworkingPerformance"] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Indicates the enablement of Advanced Networking functionalities of - observability and security on AKS clusters. When this is set to true, all observability and - security features will be set to enabled unless explicitly disabled. If not specified, the - default is false. - :paramtype enabled: bool - :keyword observability: Observability profile to enable advanced network metrics and flow logs - with historical contexts. - :paramtype observability: ~azure.mgmt.containerservice.models.AdvancedNetworkingObservability - :keyword security: Security profile to enable security features on cilium-based cluster. - :paramtype security: ~azure.mgmt.containerservice.models.AdvancedNetworkingSecurity - :keyword performance: Profile to enable performance-enhancing features on clusters that use - Azure CNI powered by Cilium. - :paramtype performance: ~azure.mgmt.containerservice.models.AdvancedNetworkingPerformance - """ - super().__init__(**kwargs) - self.enabled = enabled - self.observability = observability - self.security = security - self.performance = performance - - -class AdvancedNetworkingObservability(_serialization.Model): - """Observability profile to enable advanced network metrics and flow logs with historical - contexts. - - :ivar enabled: Indicates the enablement of Advanced Networking observability functionalities on - clusters. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Indicates the enablement of Advanced Networking observability functionalities - on clusters. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class AdvancedNetworkingPerformance(_serialization.Model): - """Profile to enable performance-enhancing features on clusters that use Azure CNI powered by - Cilium. - - :ivar acceleration_mode: Enable advanced network acceleration options. This allows users to - configure acceleration using BPF host routing. This can be enabled only with Cilium dataplane. - If not specified, the default value is None (no acceleration). The acceleration mode can be - changed on a pre-existing cluster. See https://aka.ms/acnsperformance for a detailed - explanation. Known values are: "BpfVeth" and "None". - :vartype acceleration_mode: str or ~azure.mgmt.containerservice.models.AccelerationMode - """ - - _attribute_map = { - "acceleration_mode": {"key": "accelerationMode", "type": "str"}, - } - - def __init__(self, *, acceleration_mode: Union[str, "_models.AccelerationMode"] = "None", **kwargs: Any) -> None: - """ - :keyword acceleration_mode: Enable advanced network acceleration options. This allows users to - configure acceleration using BPF host routing. This can be enabled only with Cilium dataplane. - If not specified, the default value is None (no acceleration). The acceleration mode can be - changed on a pre-existing cluster. See https://aka.ms/acnsperformance for a detailed - explanation. Known values are: "BpfVeth" and "None". - :paramtype acceleration_mode: str or ~azure.mgmt.containerservice.models.AccelerationMode - """ - super().__init__(**kwargs) - self.acceleration_mode = acceleration_mode - - -class AdvancedNetworkingSecurity(_serialization.Model): - """Security profile to enable security features on cilium-based cluster. - - :ivar enabled: Configure Advanced Networking Security features on Cilium clusters. See - individual fields for their default values. - :vartype enabled: bool - :ivar advanced_network_policies: Enable advanced network policies. This allows users to - configure Layer 7 network policies (FQDN, HTTP, Kafka). Policies themselves must be configured - via the Cilium Network Policy resources, see - https://docs.cilium.io/en/latest/security/policy/index.html. This can be enabled only on - cilium-based clusters. If not specified, the default value is FQDN if security.enabled is set - to true. Known values are: "L7", "FQDN", and "None". - :vartype advanced_network_policies: str or - ~azure.mgmt.containerservice.models.AdvancedNetworkPolicies - :ivar transit_encryption: Encryption configuration for Cilium-based clusters. Once enabled all - traffic between Cilium managed pods will be encrypted when it leaves the node boundary. - :vartype transit_encryption: - ~azure.mgmt.containerservice.models.AdvancedNetworkingSecurityTransitEncryption - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "advanced_network_policies": {"key": "advancedNetworkPolicies", "type": "str"}, - "transit_encryption": {"key": "transitEncryption", "type": "AdvancedNetworkingSecurityTransitEncryption"}, - } - - def __init__( - self, - *, - enabled: Optional[bool] = None, - advanced_network_policies: Optional[Union[str, "_models.AdvancedNetworkPolicies"]] = None, - transit_encryption: Optional["_models.AdvancedNetworkingSecurityTransitEncryption"] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Configure Advanced Networking Security features on Cilium clusters. See - individual fields for their default values. - :paramtype enabled: bool - :keyword advanced_network_policies: Enable advanced network policies. This allows users to - configure Layer 7 network policies (FQDN, HTTP, Kafka). Policies themselves must be configured - via the Cilium Network Policy resources, see - https://docs.cilium.io/en/latest/security/policy/index.html. This can be enabled only on - cilium-based clusters. If not specified, the default value is FQDN if security.enabled is set - to true. Known values are: "L7", "FQDN", and "None". - :paramtype advanced_network_policies: str or - ~azure.mgmt.containerservice.models.AdvancedNetworkPolicies - :keyword transit_encryption: Encryption configuration for Cilium-based clusters. Once enabled - all traffic between Cilium managed pods will be encrypted when it leaves the node boundary. - :paramtype transit_encryption: - ~azure.mgmt.containerservice.models.AdvancedNetworkingSecurityTransitEncryption - """ - super().__init__(**kwargs) - self.enabled = enabled - self.advanced_network_policies = advanced_network_policies - self.transit_encryption = transit_encryption - - -class AdvancedNetworkingSecurityTransitEncryption(_serialization.Model): # pylint: disable=name-too-long - """Encryption configuration for Cilium-based clusters. Once enabled all traffic between Cilium - managed pods will be encrypted when it leaves the node boundary. - - :ivar type: Configures pod-to-pod encryption. This can be enabled only on Cilium-based - clusters. If not specified, the default value is None. Known values are: "WireGuard" and - "None". - :vartype type: str or ~azure.mgmt.containerservice.models.TransitEncryptionType - """ - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, *, type: Optional[Union[str, "_models.TransitEncryptionType"]] = None, **kwargs: Any) -> None: - """ - :keyword type: Configures pod-to-pod encryption. This can be enabled only on Cilium-based - clusters. If not specified, the default value is None. Known values are: "WireGuard" and - "None". - :paramtype type: str or ~azure.mgmt.containerservice.models.TransitEncryptionType - """ - super().__init__(**kwargs) - self.type = type - - -class SubResource(_serialization.Model): - """Reference to another subresource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - - -class AgentPool(SubResource): - """Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value - will change when the resource is updated. Specify an if-match or if-none-match header with the - eTag value for a subsequent request to enable optimistic concurrency per the normal eTag - convention. - :vartype e_tag: str - :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :vartype count: int - :ivar vm_size: The size of the agent pool VMs. 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 OS disk type to be used for machines in the agent pool. 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.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.models.KubeletDiskType - :ivar workload_runtime: Determines the type of workload a node can run. Known values are: - "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". - :vartype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime - :ivar message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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: The ID of the subnet which agent pool nodes and optionally pods will join - on startup. 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: The ID of the subnet which pods will join when launched. 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 pod_ip_allocation_mode: Pod IP Allocation Mode. The IP allocation mode for pods in the - agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values - are: "DynamicIndividual" and "StaticBlock". - :vartype pod_ip_allocation_mode: str or ~azure.mgmt.containerservice.models.PodIPAllocationMode - :ivar max_pods: The maximum number of pods that can run on a node. - :vartype max_pods: int - :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and - "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType - :ivar os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is - Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be - changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", - "AzureLinux", "AzureLinux3", "Flatcar", "CBLMariner", "Windows2019", "Windows2022", - "Windows2025", "WindowsAnnual", "Ubuntu2204", and "Ubuntu2404". - :vartype os_sku: str or ~azure.mgmt.containerservice.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: The scale down mode to use when scaling the Agent Pool. 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.models.ScaleDownMode - :ivar type_properties_type: The type of Agent Pool. Known values are: - "VirtualMachineScaleSets", "AvailabilitySet", and "VirtualMachines". - :vartype type_properties_type: str or ~azure.mgmt.containerservice.models.AgentPoolType - :ivar mode: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at - all times. For additional information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", - "Gateway", "ManagedSystem", and "Machines". - :vartype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode - :ivar orchestrator_version: The version of Kubernetes specified by the user. 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: The version of Kubernetes running on the Agent Pool. 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_strategy: Defines the upgrade strategy for the agent pool. The default is - Rolling. Known values are: "Rolling" and "BlueGreen". - :vartype upgrade_strategy: str or ~azure.mgmt.containerservice.models.UpgradeStrategy - :ivar upgrade_settings: Settings for upgrading the agentpool. Applies when upgrade strategy is - set to Rolling. - :vartype upgrade_settings: ~azure.mgmt.containerservice.models.AgentPoolUpgradeSettings - :ivar upgrade_settings_blue_green: Settings for Blue-Green upgrade on the agentpool. Applies - when upgrade strategy is set to BlueGreen. - :vartype upgrade_settings_blue_green: - ~azure.mgmt.containerservice.models.AgentPoolBlueGreenUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Whether the Agent Pool is running or stopped. 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.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: Whether each node is allocated its own 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 node_public_ip_prefix_id: The public IP prefix ID which VM nodes should use IPs from. - 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.models.ScaleSetPriority - :ivar scale_set_eviction_policy: The Virtual Machine Scale Set eviction policy to use. 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.models.ScaleSetEvictionPolicy - :ivar spot_max_price: The max price (in US Dollars) you are willing to pay for spot instances. - Possible values are any decimal value greater than zero or -1 which indicates default price to - be up-to on-demand. Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :vartype spot_max_price: float - :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. - :vartype tags: dict[str, str] - :ivar node_labels: The node labels to be persisted across all nodes in agent pool. - :vartype node_labels: dict[str, str] - :ivar node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :vartype node_taints: list[str] - :ivar node_initialization_taints: Taints added on the nodes during creation that will not be - reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl - call. This field can be modified after node pool is created, but nodes will not be recreated - with new taints until another operation that requires recreation (e.g. node image upgrade) - happens. These taints allow for required configuration to run before the node is ready to - accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl - taint nodes node1 key1=value1:NoSchedule-``. - :vartype node_initialization_taints: list[str] - :ivar proximity_placement_group_id: The ID for Proximity Placement Group. - :vartype proximity_placement_group_id: str - :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. - :vartype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig - :ivar linux_os_config: The OS configuration of Linux agent nodes. - :vartype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig - :ivar enable_encryption_at_host: Whether to enable host based OS and data drive encryption. - 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: Whether to use a FIPS-enabled OS. 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.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.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: The fully qualified resource ID of the Dedicated Host Group to provision - virtual machines from, used only in creation scenario and not allowed to changed once set. 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.models.AgentPoolWindowsProfile - :ivar network_profile: Network-related settings of an agent pool. - :vartype network_profile: ~azure.mgmt.containerservice.models.AgentPoolNetworkProfile - :ivar security_profile: The security settings of an agent pool. - :vartype security_profile: ~azure.mgmt.containerservice.models.AgentPoolSecurityProfile - :ivar gpu_profile: The GPU settings of an agent pool. - :vartype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile - :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. - :vartype artifact_streaming_profile: - ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile - :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. - :vartype virtual_machines_profile: ~azure.mgmt.containerservice.models.VirtualMachinesProfile - :ivar virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. - :vartype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.models.VirtualMachineNodes] - :ivar gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field - cannot be set if agent pool mode is not Gateway. - :vartype gateway_profile: ~azure.mgmt.containerservice.models.AgentPoolGatewayProfile - :ivar status: Contains read-only information about the Agent Pool. - :vartype status: ~azure.mgmt.containerservice.models.AgentPoolStatus - :ivar local_dns_profile: Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. - LocalDNS helps improve performance and reliability of DNS resolution in an AKS cluster. For - more details see aka.ms/aks/localdns. - :vartype local_dns_profile: ~azure.mgmt.containerservice.models.LocalDNSProfile - :ivar node_customization_profile: Settings to determine the node customization used to - provision nodes in a pool. - :vartype node_customization_profile: - ~azure.mgmt.containerservice.models.NodeCustomizationProfile - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "e_tag": {"readonly": True}, - "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, - "current_orchestrator_version": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "e_tag": {"key": "properties.eTag", "type": "str"}, - "count": {"key": "properties.count", "type": "int"}, - "vm_size": {"key": "properties.vmSize", "type": "str"}, - "os_disk_size_gb": {"key": "properties.osDiskSizeGB", "type": "int"}, - "os_disk_type": {"key": "properties.osDiskType", "type": "str"}, - "kubelet_disk_type": {"key": "properties.kubeletDiskType", "type": "str"}, - "workload_runtime": {"key": "properties.workloadRuntime", "type": "str"}, - "message_of_the_day": {"key": "properties.messageOfTheDay", "type": "str"}, - "vnet_subnet_id": {"key": "properties.vnetSubnetID", "type": "str"}, - "pod_subnet_id": {"key": "properties.podSubnetID", "type": "str"}, - "pod_ip_allocation_mode": {"key": "properties.podIPAllocationMode", "type": "str"}, - "max_pods": {"key": "properties.maxPods", "type": "int"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "os_sku": {"key": "properties.osSKU", "type": "str"}, - "max_count": {"key": "properties.maxCount", "type": "int"}, - "min_count": {"key": "properties.minCount", "type": "int"}, - "enable_auto_scaling": {"key": "properties.enableAutoScaling", "type": "bool"}, - "scale_down_mode": {"key": "properties.scaleDownMode", "type": "str"}, - "type_properties_type": {"key": "properties.type", "type": "str"}, - "mode": {"key": "properties.mode", "type": "str"}, - "orchestrator_version": {"key": "properties.orchestratorVersion", "type": "str"}, - "current_orchestrator_version": {"key": "properties.currentOrchestratorVersion", "type": "str"}, - "node_image_version": {"key": "properties.nodeImageVersion", "type": "str"}, - "upgrade_strategy": {"key": "properties.upgradeStrategy", "type": "str"}, - "upgrade_settings": {"key": "properties.upgradeSettings", "type": "AgentPoolUpgradeSettings"}, - "upgrade_settings_blue_green": { - "key": "properties.upgradeSettingsBlueGreen", - "type": "AgentPoolBlueGreenUpgradeSettings", - }, - "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"}, - "node_public_ip_prefix_id": {"key": "properties.nodePublicIPPrefixID", "type": "str"}, - "scale_set_priority": {"key": "properties.scaleSetPriority", "type": "str"}, - "scale_set_eviction_policy": {"key": "properties.scaleSetEvictionPolicy", "type": "str"}, - "spot_max_price": {"key": "properties.spotMaxPrice", "type": "float"}, - "tags": {"key": "properties.tags", "type": "{str}"}, - "node_labels": {"key": "properties.nodeLabels", "type": "{str}"}, - "node_taints": {"key": "properties.nodeTaints", "type": "[str]"}, - "node_initialization_taints": {"key": "properties.nodeInitializationTaints", "type": "[str]"}, - "proximity_placement_group_id": {"key": "properties.proximityPlacementGroupID", "type": "str"}, - "kubelet_config": {"key": "properties.kubeletConfig", "type": "KubeletConfig"}, - "linux_os_config": {"key": "properties.linuxOSConfig", "type": "LinuxOSConfig"}, - "enable_encryption_at_host": {"key": "properties.enableEncryptionAtHost", "type": "bool"}, - "enable_ultra_ssd": {"key": "properties.enableUltraSSD", "type": "bool"}, - "enable_fips": {"key": "properties.enableFIPS", "type": "bool"}, - "gpu_instance_profile": {"key": "properties.gpuInstanceProfile", "type": "str"}, - "creation_data": {"key": "properties.creationData", "type": "CreationData"}, - "capacity_reservation_group_id": {"key": "properties.capacityReservationGroupID", "type": "str"}, - "host_group_id": {"key": "properties.hostGroupID", "type": "str"}, - "windows_profile": {"key": "properties.windowsProfile", "type": "AgentPoolWindowsProfile"}, - "network_profile": {"key": "properties.networkProfile", "type": "AgentPoolNetworkProfile"}, - "security_profile": {"key": "properties.securityProfile", "type": "AgentPoolSecurityProfile"}, - "gpu_profile": {"key": "properties.gpuProfile", "type": "GPUProfile"}, - "artifact_streaming_profile": { - "key": "properties.artifactStreamingProfile", - "type": "AgentPoolArtifactStreamingProfile", - }, - "virtual_machines_profile": {"key": "properties.virtualMachinesProfile", "type": "VirtualMachinesProfile"}, - "virtual_machine_nodes_status": { - "key": "properties.virtualMachineNodesStatus", - "type": "[VirtualMachineNodes]", - }, - "gateway_profile": {"key": "properties.gatewayProfile", "type": "AgentPoolGatewayProfile"}, - "status": {"key": "properties.status", "type": "AgentPoolStatus"}, - "local_dns_profile": {"key": "properties.localDNSProfile", "type": "LocalDNSProfile"}, - "node_customization_profile": { - "key": "properties.nodeCustomizationProfile", - "type": "NodeCustomizationProfile", - }, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - count: Optional[int] = None, - vm_size: Optional[str] = None, - os_disk_size_gb: Optional[int] = None, - os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, - kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, - workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, - message_of_the_day: Optional[str] = None, - vnet_subnet_id: Optional[str] = None, - pod_subnet_id: Optional[str] = None, - pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, - max_pods: Optional[int] = None, - os_type: Union[str, "_models.OSType"] = "Linux", - os_sku: Optional[Union[str, "_models.OSSKU"]] = None, - max_count: Optional[int] = None, - min_count: Optional[int] = None, - enable_auto_scaling: Optional[bool] = None, - scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, - type_properties_type: Optional[Union[str, "_models.AgentPoolType"]] = None, - mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, - orchestrator_version: Optional[str] = None, - node_image_version: Optional[str] = None, - upgrade_strategy: Optional[Union[str, "_models.UpgradeStrategy"]] = None, - upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, - upgrade_settings_blue_green: Optional["_models.AgentPoolBlueGreenUpgradeSettings"] = None, - power_state: Optional["_models.PowerState"] = None, - availability_zones: Optional[list[str]] = None, - enable_node_public_ip: Optional[bool] = None, - node_public_ip_prefix_id: Optional[str] = None, - scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", - scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", - spot_max_price: float = -1, - tags: Optional[dict[str, str]] = None, - node_labels: Optional[dict[str, str]] = None, - node_taints: Optional[list[str]] = None, - node_initialization_taints: Optional[list[str]] = None, - proximity_placement_group_id: Optional[str] = None, - kubelet_config: Optional["_models.KubeletConfig"] = None, - linux_os_config: Optional["_models.LinuxOSConfig"] = None, - enable_encryption_at_host: Optional[bool] = None, - enable_ultra_ssd: Optional[bool] = None, - enable_fips: Optional[bool] = None, - gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, - creation_data: Optional["_models.CreationData"] = None, - capacity_reservation_group_id: Optional[str] = None, - host_group_id: Optional[str] = None, - windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, - network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, - security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, - gpu_profile: Optional["_models.GPUProfile"] = None, - artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, - virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, - virtual_machine_nodes_status: Optional[list["_models.VirtualMachineNodes"]] = None, - gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, - status: Optional["_models.AgentPoolStatus"] = None, - local_dns_profile: Optional["_models.LocalDNSProfile"] = None, - node_customization_profile: Optional["_models.NodeCustomizationProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :paramtype count: int - :keyword vm_size: The size of the agent pool VMs. 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 OS disk type to be used for machines in the agent pool. 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.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.models.KubeletDiskType - :keyword workload_runtime: Determines the type of workload a node can run. Known values are: - "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". - :paramtype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime - :keyword message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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: The ID of the subnet which agent pool nodes and optionally pods will - join on startup. 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: The ID of the subnet which pods will join when launched. 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 pod_ip_allocation_mode: Pod IP Allocation Mode. The IP allocation mode for pods in the - agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values - are: "DynamicIndividual" and "StaticBlock". - :paramtype pod_ip_allocation_mode: str or - ~azure.mgmt.containerservice.models.PodIPAllocationMode - :keyword max_pods: The maximum number of pods that can run on a node. - :paramtype max_pods: int - :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" - and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.models.OSType - :keyword os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is - Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be - changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", - "AzureLinux", "AzureLinux3", "Flatcar", "CBLMariner", "Windows2019", "Windows2022", - "Windows2025", "WindowsAnnual", "Ubuntu2204", and "Ubuntu2404". - :paramtype os_sku: str or ~azure.mgmt.containerservice.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: The scale down mode to use when scaling the Agent Pool. 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.models.ScaleDownMode - :keyword type_properties_type: The type of Agent Pool. Known values are: - "VirtualMachineScaleSets", "AvailabilitySet", and "VirtualMachines". - :paramtype type_properties_type: str or ~azure.mgmt.containerservice.models.AgentPoolType - :keyword mode: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool - at all times. For additional information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", - "Gateway", "ManagedSystem", and "Machines". - :paramtype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode - :keyword orchestrator_version: The version of Kubernetes specified by the user. 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 node_image_version: The version of node image. - :paramtype node_image_version: str - :keyword upgrade_strategy: Defines the upgrade strategy for the agent pool. The default is - Rolling. Known values are: "Rolling" and "BlueGreen". - :paramtype upgrade_strategy: str or ~azure.mgmt.containerservice.models.UpgradeStrategy - :keyword upgrade_settings: Settings for upgrading the agentpool. Applies when upgrade strategy - is set to Rolling. - :paramtype upgrade_settings: ~azure.mgmt.containerservice.models.AgentPoolUpgradeSettings - :keyword upgrade_settings_blue_green: Settings for Blue-Green upgrade on the agentpool. Applies - when upgrade strategy is set to BlueGreen. - :paramtype upgrade_settings_blue_green: - ~azure.mgmt.containerservice.models.AgentPoolBlueGreenUpgradeSettings - :keyword power_state: Whether the Agent Pool is running or stopped. 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.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: Whether each node is allocated its own 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 node_public_ip_prefix_id: The public IP prefix ID which VM nodes should use IPs from. - 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.models.ScaleSetPriority - :keyword scale_set_eviction_policy: The Virtual Machine Scale Set eviction policy to use. 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.models.ScaleSetEvictionPolicy - :keyword spot_max_price: The max price (in US Dollars) you are willing to pay for spot - instances. Possible values are any decimal value greater than zero or -1 which indicates - default price to be up-to on-demand. Possible values are any decimal value greater than zero or - -1 which indicates the willingness to pay any on-demand price. For more details on spot - pricing, see `spot VMs pricing - `_. - :paramtype spot_max_price: float - :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. - :paramtype tags: dict[str, str] - :keyword node_labels: The node labels to be persisted across all nodes in agent pool. - :paramtype node_labels: dict[str, str] - :keyword node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :paramtype node_taints: list[str] - :keyword node_initialization_taints: Taints added on the nodes during creation that will not be - reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl - call. This field can be modified after node pool is created, but nodes will not be recreated - with new taints until another operation that requires recreation (e.g. node image upgrade) - happens. These taints allow for required configuration to run before the node is ready to - accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl - taint nodes node1 key1=value1:NoSchedule-``. - :paramtype node_initialization_taints: list[str] - :keyword proximity_placement_group_id: The ID for Proximity Placement Group. - :paramtype proximity_placement_group_id: str - :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. - :paramtype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig - :keyword linux_os_config: The OS configuration of Linux agent nodes. - :paramtype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig - :keyword enable_encryption_at_host: Whether to enable host based OS and data drive encryption. - 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: Whether to use a FIPS-enabled OS. 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.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.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: The fully qualified resource ID of the Dedicated Host Group to - provision virtual machines from, used only in creation scenario and not allowed to changed once - set. 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.models.AgentPoolWindowsProfile - :keyword network_profile: Network-related settings of an agent pool. - :paramtype network_profile: ~azure.mgmt.containerservice.models.AgentPoolNetworkProfile - :keyword security_profile: The security settings of an agent pool. - :paramtype security_profile: ~azure.mgmt.containerservice.models.AgentPoolSecurityProfile - :keyword gpu_profile: The GPU settings of an agent pool. - :paramtype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile - :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. - :paramtype artifact_streaming_profile: - ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile - :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. - :paramtype virtual_machines_profile: ~azure.mgmt.containerservice.models.VirtualMachinesProfile - :keyword virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. - :paramtype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.models.VirtualMachineNodes] - :keyword gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field - cannot be set if agent pool mode is not Gateway. - :paramtype gateway_profile: ~azure.mgmt.containerservice.models.AgentPoolGatewayProfile - :keyword status: Contains read-only information about the Agent Pool. - :paramtype status: ~azure.mgmt.containerservice.models.AgentPoolStatus - :keyword local_dns_profile: Configures the per-node local DNS, with VnetDNS and KubeDNS - overrides. LocalDNS helps improve performance and reliability of DNS resolution in an AKS - cluster. For more details see aka.ms/aks/localdns. - :paramtype local_dns_profile: ~azure.mgmt.containerservice.models.LocalDNSProfile - :keyword node_customization_profile: Settings to determine the node customization used to - provision nodes in a pool. - :paramtype node_customization_profile: - ~azure.mgmt.containerservice.models.NodeCustomizationProfile - """ - super().__init__(**kwargs) - self.e_tag: Optional[str] = None - self.count = count - self.vm_size = vm_size - self.os_disk_size_gb = os_disk_size_gb - self.os_disk_type = os_disk_type - self.kubelet_disk_type = kubelet_disk_type - self.workload_runtime = workload_runtime - self.message_of_the_day = message_of_the_day - self.vnet_subnet_id = vnet_subnet_id - self.pod_subnet_id = pod_subnet_id - self.pod_ip_allocation_mode = pod_ip_allocation_mode - self.max_pods = max_pods - self.os_type = os_type - self.os_sku = os_sku - self.max_count = max_count - self.min_count = min_count - self.enable_auto_scaling = enable_auto_scaling - self.scale_down_mode = scale_down_mode - self.type_properties_type = type_properties_type - self.mode = mode - self.orchestrator_version = orchestrator_version - self.current_orchestrator_version: Optional[str] = None - self.node_image_version = node_image_version - self.upgrade_strategy = upgrade_strategy - self.upgrade_settings = upgrade_settings - self.upgrade_settings_blue_green = upgrade_settings_blue_green - self.provisioning_state: Optional[str] = None - self.power_state = power_state - self.availability_zones = availability_zones - self.enable_node_public_ip = enable_node_public_ip - self.node_public_ip_prefix_id = node_public_ip_prefix_id - self.scale_set_priority = scale_set_priority - self.scale_set_eviction_policy = scale_set_eviction_policy - self.spot_max_price = spot_max_price - self.tags = tags - self.node_labels = node_labels - self.node_taints = node_taints - self.node_initialization_taints = node_initialization_taints - self.proximity_placement_group_id = proximity_placement_group_id - self.kubelet_config = kubelet_config - self.linux_os_config = linux_os_config - self.enable_encryption_at_host = enable_encryption_at_host - self.enable_ultra_ssd = enable_ultra_ssd - self.enable_fips = enable_fips - self.gpu_instance_profile = gpu_instance_profile - self.creation_data = creation_data - self.capacity_reservation_group_id = capacity_reservation_group_id - self.host_group_id = host_group_id - self.windows_profile = windows_profile - self.network_profile = network_profile - self.security_profile = security_profile - self.gpu_profile = gpu_profile - self.artifact_streaming_profile = artifact_streaming_profile - self.virtual_machines_profile = virtual_machines_profile - self.virtual_machine_nodes_status = virtual_machine_nodes_status - self.gateway_profile = gateway_profile - self.status = status - self.local_dns_profile = local_dns_profile - self.node_customization_profile = node_customization_profile - - -class AgentPoolArtifactStreamingProfile(_serialization.Model): - """AgentPoolArtifactStreamingProfile. - - :ivar enabled: Artifact streaming speeds up the cold-start of containers on a node through - on-demand image loading. To use this feature, container images must also enable artifact - streaming on ACR. If not specified, the default is false. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Artifact streaming speeds up the cold-start of containers on a node through - on-demand image loading. To use this feature, container images must also enable artifact - streaming on ACR. If not specified, the default is false. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class AgentPoolAvailableVersions(_serialization.Model): - """The list of available versions for an agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the agent pool version list. - :vartype id: str - :ivar name: The name of the agent pool version list. - :vartype name: str - :ivar type: Type of the agent pool version list. - :vartype type: str - :ivar agent_pool_versions: List of versions available for agent pool. - :vartype agent_pool_versions: - list[~azure.mgmt.containerservice.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: Any - ) -> None: - """ - :keyword agent_pool_versions: List of versions available for agent pool. - :paramtype agent_pool_versions: - list[~azure.mgmt.containerservice.models.AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem] - """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - self.agent_pool_versions = agent_pool_versions - - -class AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem(_serialization.Model): # pylint: disable=name-too-long - """AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem. - - :ivar default: Whether this version is the default agent pool version. - :vartype default: bool - :ivar kubernetes_version: The Kubernetes version (major.minor.patch). - :vartype kubernetes_version: str - :ivar is_preview: Whether Kubernetes version is currently in preview. - :vartype is_preview: bool - """ - - _attribute_map = { - "default": {"key": "default", "type": "bool"}, - "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, - "is_preview": {"key": "isPreview", "type": "bool"}, - } - - def __init__( - self, - *, - default: Optional[bool] = None, - kubernetes_version: Optional[str] = None, - is_preview: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword default: Whether this version is the default agent pool version. - :paramtype default: bool - :keyword kubernetes_version: The Kubernetes version (major.minor.patch). - :paramtype kubernetes_version: str - :keyword is_preview: Whether Kubernetes version is currently in preview. - :paramtype is_preview: bool - """ - super().__init__(**kwargs) - self.default = default - self.kubernetes_version = kubernetes_version - self.is_preview = is_preview - - -class AgentPoolBlueGreenUpgradeSettings(_serialization.Model): - """Settings for blue-green upgrade on an agentpool. - - :ivar drain_batch_size: The number or percentage of nodes to drain in batch during blue-green - upgrade. Must be a non-zero number. 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 number - of blue nodes of the initial upgrade operation. For percentages, fractional nodes are rounded - up. If not specified, the default is 10%. For more information, including best practices, see: - https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. - :vartype drain_batch_size: str - :ivar drain_timeout_in_minutes: The drain timeout for a node, i.e., the amount of time (in - minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time - honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not - specified, the default is 30 minutes. - :vartype drain_timeout_in_minutes: int - :ivar batch_soak_duration_in_minutes: The soak duration after draining a batch of nodes, i.e., - the amount of time (in minutes) to wait after draining a batch of nodes before moving on the - next batch. If not specified, the default is 15 minutes. - :vartype batch_soak_duration_in_minutes: int - :ivar final_soak_duration_in_minutes: The soak duration for a node pool, i.e., the amount of - time (in minutes) to wait after all old nodes are drained before we remove the old nodes. If - not specified, the default is 60 minutes. Only applicable for blue-green upgrade strategy. - :vartype final_soak_duration_in_minutes: int - """ - - _validation = { - "drain_timeout_in_minutes": {"maximum": 1440, "minimum": 1}, - "batch_soak_duration_in_minutes": {"maximum": 1440, "minimum": 0}, - "final_soak_duration_in_minutes": {"maximum": 10080, "minimum": 0}, - } - - _attribute_map = { - "drain_batch_size": {"key": "drainBatchSize", "type": "str"}, - "drain_timeout_in_minutes": {"key": "drainTimeoutInMinutes", "type": "int"}, - "batch_soak_duration_in_minutes": {"key": "batchSoakDurationInMinutes", "type": "int"}, - "final_soak_duration_in_minutes": {"key": "finalSoakDurationInMinutes", "type": "int"}, - } - - def __init__( - self, - *, - drain_batch_size: Optional[str] = None, - drain_timeout_in_minutes: Optional[int] = None, - batch_soak_duration_in_minutes: Optional[int] = None, - final_soak_duration_in_minutes: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword drain_batch_size: The number or percentage of nodes to drain in batch during - blue-green upgrade. Must be a non-zero number. 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 - number of blue nodes of the initial upgrade operation. For percentages, fractional nodes are - rounded up. If not specified, the default is 10%. For more information, including best - practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. - :paramtype drain_batch_size: str - :keyword drain_timeout_in_minutes: The drain timeout for a node, i.e., the amount of time (in - minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time - honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not - specified, the default is 30 minutes. - :paramtype drain_timeout_in_minutes: int - :keyword batch_soak_duration_in_minutes: The soak duration after draining a batch of nodes, - i.e., the amount of time (in minutes) to wait after draining a batch of nodes before moving on - the next batch. If not specified, the default is 15 minutes. - :paramtype batch_soak_duration_in_minutes: int - :keyword final_soak_duration_in_minutes: The soak duration for a node pool, i.e., the amount of - time (in minutes) to wait after all old nodes are drained before we remove the old nodes. If - not specified, the default is 60 minutes. Only applicable for blue-green upgrade strategy. - :paramtype final_soak_duration_in_minutes: int - """ - super().__init__(**kwargs) - self.drain_batch_size = drain_batch_size - self.drain_timeout_in_minutes = drain_timeout_in_minutes - self.batch_soak_duration_in_minutes = batch_soak_duration_in_minutes - self.final_soak_duration_in_minutes = final_soak_duration_in_minutes - - -class AgentPoolDeleteMachinesParameter(_serialization.Model): - """Specifies a list of machine names from the agent pool to be deleted. - - All required parameters must be populated in order to send to server. - - :ivar machine_names: The agent pool machine names. Required. - :vartype machine_names: list[str] - """ - - _validation = { - "machine_names": {"required": True}, - } - - _attribute_map = { - "machine_names": {"key": "machineNames", "type": "[str]"}, - } - - def __init__(self, *, machine_names: list[str], **kwargs: Any) -> None: - """ - :keyword machine_names: The agent pool machine names. Required. - :paramtype machine_names: list[str] - """ - super().__init__(**kwargs) - self.machine_names = machine_names - - -class AgentPoolGatewayProfile(_serialization.Model): - """Profile of the managed cluster gateway agent pool. - - :ivar public_ip_prefix_size: The Gateway agent pool associates one public IPPrefix for each - static egress gateway to provide public egress. The size of Public IPPrefix should be selected - by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The - IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public - IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 - nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. - :vartype public_ip_prefix_size: int - """ - - _validation = { - "public_ip_prefix_size": {"maximum": 31, "minimum": 28}, - } - - _attribute_map = { - "public_ip_prefix_size": {"key": "publicIPPrefixSize", "type": "int"}, - } - - def __init__(self, *, public_ip_prefix_size: int = 31, **kwargs: Any) -> None: - """ - :keyword public_ip_prefix_size: The Gateway agent pool associates one public IPPrefix for each - static egress gateway to provide public egress. The size of Public IPPrefix should be selected - by the user. Each node in the agent pool is assigned with one IP from the IPPrefix. The - IPPrefix size thus serves as a cap on the size of the Gateway agent pool. Due to Azure public - IPPrefix size limitation, the valid value range is [28, 31] (/31 = 2 nodes/IPs, /30 = 4 - nodes/IPs, /29 = 8 nodes/IPs, /28 = 16 nodes/IPs). The default value is 31. - :paramtype public_ip_prefix_size: int - """ - super().__init__(**kwargs) - self.public_ip_prefix_size = public_ip_prefix_size - - -class 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.models.AgentPool] - :ivar next_link: The URL to get the next set of agent pool results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[AgentPool]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.AgentPool"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of agent pools. - :paramtype value: list[~azure.mgmt.containerservice.models.AgentPool] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class AgentPoolNetworkProfile(_serialization.Model): - """Network settings of an agent pool. - - :ivar node_public_ip_tags: IPTags of instance-level public IPs. - :vartype node_public_ip_tags: list[~azure.mgmt.containerservice.models.IPTag] - :ivar allowed_host_ports: The port ranges that are allowed to access. The specified ranges are - allowed to overlap. - :vartype allowed_host_ports: list[~azure.mgmt.containerservice.models.PortRange] - :ivar application_security_groups: The IDs of the application security groups which agent pool - will associate when created. - :vartype application_security_groups: list[str] - """ - - _attribute_map = { - "node_public_ip_tags": {"key": "nodePublicIPTags", "type": "[IPTag]"}, - "allowed_host_ports": {"key": "allowedHostPorts", "type": "[PortRange]"}, - "application_security_groups": {"key": "applicationSecurityGroups", "type": "[str]"}, - } - - def __init__( - self, - *, - node_public_ip_tags: Optional[list["_models.IPTag"]] = None, - allowed_host_ports: Optional[list["_models.PortRange"]] = None, - application_security_groups: Optional[list[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword node_public_ip_tags: IPTags of instance-level public IPs. - :paramtype node_public_ip_tags: list[~azure.mgmt.containerservice.models.IPTag] - :keyword allowed_host_ports: The port ranges that are allowed to access. The specified ranges - are allowed to overlap. - :paramtype allowed_host_ports: list[~azure.mgmt.containerservice.models.PortRange] - :keyword application_security_groups: The IDs of the application security groups which agent - pool will associate when created. - :paramtype application_security_groups: list[str] - """ - super().__init__(**kwargs) - self.node_public_ip_tags = node_public_ip_tags - self.allowed_host_ports = allowed_host_ports - self.application_security_groups = application_security_groups - - -class AgentPoolRecentlyUsedVersion(_serialization.Model): - """A historical version that can be used for rollback operations. - - :ivar orchestrator_version: The Kubernetes version (major.minor.patch) available for rollback. - :vartype orchestrator_version: str - :ivar node_image_version: The node image version available for rollback. - :vartype node_image_version: str - :ivar timestamp: The timestamp when this version was last used. - :vartype timestamp: ~datetime.datetime - """ - - _attribute_map = { - "orchestrator_version": {"key": "orchestratorVersion", "type": "str"}, - "node_image_version": {"key": "nodeImageVersion", "type": "str"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - } - - def __init__( - self, - *, - orchestrator_version: Optional[str] = None, - node_image_version: Optional[str] = None, - timestamp: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword orchestrator_version: The Kubernetes version (major.minor.patch) available for - rollback. - :paramtype orchestrator_version: str - :keyword node_image_version: The node image version available for rollback. - :paramtype node_image_version: str - :keyword timestamp: The timestamp when this version was last used. - :paramtype timestamp: ~datetime.datetime - """ - super().__init__(**kwargs) - self.orchestrator_version = orchestrator_version - self.node_image_version = node_image_version - self.timestamp = timestamp - - -class AgentPoolSecurityProfile(_serialization.Model): - """The security settings of an agent pool. - - :ivar ssh_access: SSH access method of an agent pool. Known values are: "LocalUser", - "Disabled", and "EntraId". - :vartype ssh_access: str or ~azure.mgmt.containerservice.models.AgentPoolSSHAccess - :ivar enable_vtpm: vTPM is a Trusted Launch feature for configuring a dedicated secure vault - for keys and measurements held locally on the node. For more details, see - aka.ms/aks/trustedlaunch. If not specified, the default is false. - :vartype enable_vtpm: bool - :ivar enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only - signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. - If not specified, the default is false. - :vartype enable_secure_boot: bool - """ - - _attribute_map = { - "ssh_access": {"key": "sshAccess", "type": "str"}, - "enable_vtpm": {"key": "enableVTPM", "type": "bool"}, - "enable_secure_boot": {"key": "enableSecureBoot", "type": "bool"}, - } - - def __init__( - self, - *, - ssh_access: Optional[Union[str, "_models.AgentPoolSSHAccess"]] = None, - enable_vtpm: Optional[bool] = None, - enable_secure_boot: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword ssh_access: SSH access method of an agent pool. Known values are: "LocalUser", - "Disabled", and "EntraId". - :paramtype ssh_access: str or ~azure.mgmt.containerservice.models.AgentPoolSSHAccess - :keyword enable_vtpm: vTPM is a Trusted Launch feature for configuring a dedicated secure vault - for keys and measurements held locally on the node. For more details, see - aka.ms/aks/trustedlaunch. If not specified, the default is false. - :paramtype enable_vtpm: bool - :keyword enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only - signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. - If not specified, the default is false. - :paramtype enable_secure_boot: bool - """ - super().__init__(**kwargs) - self.ssh_access = ssh_access - self.enable_vtpm = enable_vtpm - self.enable_secure_boot = enable_secure_boot - - -class AgentPoolStatus(_serialization.Model): - """Contains read-only information about the Agent Pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_error: The error detail information of the agent pool. Preserves the - detailed info of failure. If there was no error, this field is omitted. - :vartype provisioning_error: ~azure.mgmt.containerservice.models.ErrorDetail - """ - - _validation = { - "provisioning_error": {"readonly": True}, - } - - _attribute_map = { - "provisioning_error": {"key": "provisioningError", "type": "ErrorDetail"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provisioning_error: Optional["_models.ErrorDetail"] = 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 server. - - :ivar id: The ID of the agent pool upgrade profile. - :vartype id: str - :ivar name: The name of the agent pool upgrade profile. - :vartype name: str - :ivar type: The type of the agent pool upgrade profile. - :vartype type: str - :ivar kubernetes_version: The Kubernetes version (major.minor.patch). Required. - :vartype kubernetes_version: str - :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and - "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType - :ivar upgrades: List of orchestrator types and versions available for upgrade. - :vartype upgrades: - list[~azure.mgmt.containerservice.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :ivar components_by_releases: List of components grouped by kubernetes major.minor version. - :vartype components_by_releases: list[~azure.mgmt.containerservice.models.ComponentsByRelease] - :ivar recently_used_versions: List of historical good versions for rollback operations. - :vartype recently_used_versions: - list[~azure.mgmt.containerservice.models.AgentPoolRecentlyUsedVersion] - :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}, - "recently_used_versions": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "upgrades": {"key": "properties.upgrades", "type": "[AgentPoolUpgradeProfilePropertiesUpgradesItem]"}, - "components_by_releases": {"key": "properties.componentsByReleases", "type": "[ComponentsByRelease]"}, - "recently_used_versions": {"key": "properties.recentlyUsedVersions", "type": "[AgentPoolRecentlyUsedVersion]"}, - "latest_node_image_version": {"key": "properties.latestNodeImageVersion", "type": "str"}, - } - - def __init__( - self, - *, - kubernetes_version: str, - os_type: Union[str, "_models.OSType"] = "Linux", - upgrades: Optional[list["_models.AgentPoolUpgradeProfilePropertiesUpgradesItem"]] = None, - components_by_releases: Optional[list["_models.ComponentsByRelease"]] = None, - latest_node_image_version: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword kubernetes_version: The Kubernetes version (major.minor.patch). Required. - :paramtype kubernetes_version: str - :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" - and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.models.OSType - :keyword upgrades: List of orchestrator types and versions available for upgrade. - :paramtype upgrades: - list[~azure.mgmt.containerservice.models.AgentPoolUpgradeProfilePropertiesUpgradesItem] - :keyword components_by_releases: List of components grouped by kubernetes major.minor version. - :paramtype components_by_releases: - list[~azure.mgmt.containerservice.models.ComponentsByRelease] - :keyword latest_node_image_version: The latest AKS supported node image version. - :paramtype latest_node_image_version: str - """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - self.kubernetes_version = kubernetes_version - self.os_type = os_type - self.upgrades = upgrades - self.components_by_releases = components_by_releases - self.recently_used_versions: Optional[list["_models.AgentPoolRecentlyUsedVersion"]] = None - self.latest_node_image_version = latest_node_image_version - - -class AgentPoolUpgradeProfilePropertiesUpgradesItem(_serialization.Model): # pylint: disable=name-too-long - """AgentPoolUpgradeProfilePropertiesUpgradesItem. - - :ivar kubernetes_version: The Kubernetes version (major.minor.patch). - :vartype kubernetes_version: str - :ivar is_preview: Whether the Kubernetes version is currently in preview. - :vartype is_preview: bool - :ivar is_out_of_support: Whether the Kubernetes version is out of support. - :vartype is_out_of_support: bool - """ - - _attribute_map = { - "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, - "is_preview": {"key": "isPreview", "type": "bool"}, - "is_out_of_support": {"key": "isOutOfSupport", "type": "bool"}, - } - - def __init__( - self, - *, - kubernetes_version: Optional[str] = None, - is_preview: Optional[bool] = None, - is_out_of_support: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword kubernetes_version: The Kubernetes version (major.minor.patch). - :paramtype kubernetes_version: str - :keyword is_preview: Whether the Kubernetes version is currently in preview. - :paramtype is_preview: bool - :keyword is_out_of_support: Whether the Kubernetes version is out of support. - :paramtype is_out_of_support: bool - """ - super().__init__(**kwargs) - self.kubernetes_version = kubernetes_version - self.is_preview = is_preview - self.is_out_of_support = is_out_of_support - - -class AgentPoolUpgradeSettings(_serialization.Model): - """Settings for rolling upgrade on an agentpool. - - :ivar max_surge: The maximum number or percentage of nodes that are surged during upgrade. 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 10%. For more - information, including best practices, see: - https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. - :vartype max_surge: str - :ivar max_unavailable: The maximum number or percentage of nodes that can be simultaneously - unavailable during upgrade. This can either be set to an integer (e.g. '1') or a percentage - (e.g. '5%'). If a percentage is specified, it is the percentage of the total agent pool size at - the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, - the default is 0. For more information, including best practices, see: - https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. - :vartype max_unavailable: str - :ivar max_blocked_nodes: The maximum number or percentage of extra nodes that are allowed to be - blocked in the agent pool during an upgrade when undrainable node behavior is Cordon. 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 maxSurge. This - must always be greater than or equal to maxSurge. For more information, including best - practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. - :vartype max_blocked_nodes: str - :ivar drain_timeout_in_minutes: The drain timeout for a node. The amount of time (in minutes) - to wait on eviction of pods and graceful termination per node. This eviction wait time honors - waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not - specified, the default is 30 minutes. - :vartype drain_timeout_in_minutes: int - :ivar node_soak_duration_in_minutes: The soak duration for a node. The amount of time (in - minutes) to wait after draining a node and before reimaging it and moving on to next node. If - not specified, the default is 0 minutes. - :vartype node_soak_duration_in_minutes: int - :ivar undrainable_node_behavior: Defines the behavior for undrainable nodes during upgrade. The - most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, such - as pod termination grace period is exceeding the remaining per-node drain timeout or pod is - still being in a running state, can also cause undrainable nodes. Known values are: "Cordon" - and "Schedule". - :vartype undrainable_node_behavior: str or - ~azure.mgmt.containerservice.models.UndrainableNodeBehavior - """ - - _validation = { - "drain_timeout_in_minutes": {"maximum": 1440, "minimum": 1}, - "node_soak_duration_in_minutes": {"maximum": 30, "minimum": 0}, - } - - _attribute_map = { - "max_surge": {"key": "maxSurge", "type": "str"}, - "max_unavailable": {"key": "maxUnavailable", "type": "str"}, - "max_blocked_nodes": {"key": "maxBlockedNodes", "type": "str"}, - "drain_timeout_in_minutes": {"key": "drainTimeoutInMinutes", "type": "int"}, - "node_soak_duration_in_minutes": {"key": "nodeSoakDurationInMinutes", "type": "int"}, - "undrainable_node_behavior": {"key": "undrainableNodeBehavior", "type": "str"}, - } - - def __init__( - self, - *, - max_surge: Optional[str] = None, - max_unavailable: Optional[str] = None, - max_blocked_nodes: Optional[str] = None, - drain_timeout_in_minutes: Optional[int] = None, - node_soak_duration_in_minutes: Optional[int] = None, - undrainable_node_behavior: Optional[Union[str, "_models.UndrainableNodeBehavior"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword max_surge: The maximum number or percentage of nodes that are surged during upgrade. - 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 10%. For more - information, including best practices, see: - https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. - :paramtype max_surge: str - :keyword max_unavailable: The maximum number or percentage of nodes that can be simultaneously - unavailable during upgrade. This can either be set to an integer (e.g. '1') or a percentage - (e.g. '5%'). If a percentage is specified, it is the percentage of the total agent pool size at - the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified, - the default is 0. For more information, including best practices, see: - https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. - :paramtype max_unavailable: str - :keyword max_blocked_nodes: The maximum number or percentage of extra nodes that are allowed to - be blocked in the agent pool during an upgrade when undrainable node behavior is Cordon. 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 maxSurge. This - must always be greater than or equal to maxSurge. For more information, including best - practices, see: https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster. - :paramtype max_blocked_nodes: str - :keyword drain_timeout_in_minutes: The drain timeout for a node. The amount of time (in - minutes) to wait on eviction of pods and graceful termination per node. This eviction wait time - honors waiting on pod disruption budgets. If this time is exceeded, the upgrade fails. If not - specified, the default is 30 minutes. - :paramtype drain_timeout_in_minutes: int - :keyword node_soak_duration_in_minutes: The soak duration for a node. The amount of time (in - minutes) to wait after draining a node and before reimaging it and moving on to next node. If - not specified, the default is 0 minutes. - :paramtype node_soak_duration_in_minutes: int - :keyword undrainable_node_behavior: Defines the behavior for undrainable nodes during upgrade. - The most common cause of undrainable nodes is Pod Disruption Budgets (PDBs), but other issues, - such as pod termination grace period is exceeding the remaining per-node drain timeout or pod - is still being in a running state, can also cause undrainable nodes. Known values are: "Cordon" - and "Schedule". - :paramtype undrainable_node_behavior: str or - ~azure.mgmt.containerservice.models.UndrainableNodeBehavior - """ - super().__init__(**kwargs) - self.max_surge = max_surge - self.max_unavailable = max_unavailable - self.max_blocked_nodes = max_blocked_nodes - self.drain_timeout_in_minutes = drain_timeout_in_minutes - self.node_soak_duration_in_minutes = node_soak_duration_in_minutes - self.undrainable_node_behavior = undrainable_node_behavior - - -class AgentPoolWindowsProfile(_serialization.Model): - """The Windows agent pool's specific profile. - - :ivar disable_outbound_nat: Whether to disable OutboundNAT in windows nodes. The default value - is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway and the - Windows agent pool does not have node public IP enabled. - :vartype disable_outbound_nat: bool - """ - - _attribute_map = { - "disable_outbound_nat": {"key": "disableOutboundNat", "type": "bool"}, - } - - def __init__(self, *, disable_outbound_nat: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword disable_outbound_nat: Whether to disable OutboundNAT in windows nodes. The default - value is false. Outbound NAT can only be disabled if the cluster outboundType is NAT Gateway - and the Windows agent pool does not have node public IP enabled. - :paramtype disable_outbound_nat: bool - """ - super().__init__(**kwargs) - self.disable_outbound_nat = disable_outbound_nat - - -class AutoScaleProfile(_serialization.Model): - """Specifications on auto-scaling. - - :ivar size: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', - 'Standard_E16s_v3' or 'Standard_D16s_v5'. - :vartype size: str - :ivar min_count: The minimum number of nodes of the specified sizes. - :vartype min_count: int - :ivar max_count: The maximum number of nodes of the specified sizes. - :vartype max_count: int - """ - - _attribute_map = { - "size": {"key": "size", "type": "str"}, - "min_count": {"key": "minCount", "type": "int"}, - "max_count": {"key": "maxCount", "type": "int"}, - } - - def __init__( - self, - *, - size: Optional[str] = None, - min_count: Optional[int] = None, - max_count: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword size: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', - 'Standard_E16s_v3' or 'Standard_D16s_v5'. - :paramtype size: str - :keyword min_count: The minimum number of nodes of the specified sizes. - :paramtype min_count: int - :keyword max_count: The maximum number of nodes of the specified sizes. - :paramtype max_count: int - """ - super().__init__(**kwargs) - self.size = size - self.min_count = min_count - self.max_count = max_count - - -class AzureKeyVaultKms(_serialization.Model): - """Azure Key Vault key management service settings for the security profile. - - :ivar enabled: Whether to enable Azure Key Vault key management service. The default is false. - :vartype enabled: bool - :ivar key_id: Identifier of Azure Key Vault key. See `key identifier format - `_ - 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 the key vault. 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.models.KeyVaultNetworkAccessTypes - :ivar key_vault_resource_id: Resource ID of key vault. When keyVaultNetworkAccess is - ``Private``\\ , this field is required and must be a valid resource ID. When - keyVaultNetworkAccess is ``Public``\\ , leave the field empty. - :vartype key_vault_resource_id: str - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "key_id": {"key": "keyId", "type": "str"}, - "key_vault_network_access": {"key": "keyVaultNetworkAccess", "type": "str"}, - "key_vault_resource_id": {"key": "keyVaultResourceId", "type": "str"}, - } - - def __init__( - self, - *, - enabled: Optional[bool] = None, - key_id: Optional[str] = None, - key_vault_network_access: Union[str, "_models.KeyVaultNetworkAccessTypes"] = "Public", - key_vault_resource_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Whether to enable Azure Key Vault key management service. The default is - false. - :paramtype enabled: bool - :keyword key_id: Identifier of Azure Key Vault key. See `key identifier format - `_ - 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 the key vault. 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.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 ClusterUpgradeSettings(_serialization.Model): - """Settings for upgrading a cluster. - - :ivar override_settings: Settings for overrides. - :vartype override_settings: ~azure.mgmt.containerservice.models.UpgradeOverrideSettings - """ - - _attribute_map = { - "override_settings": {"key": "overrideSettings", "type": "UpgradeOverrideSettings"}, - } - - def __init__(self, *, override_settings: Optional["_models.UpgradeOverrideSettings"] = None, **kwargs: Any) -> None: - """ - :keyword override_settings: Settings for overrides. - :paramtype override_settings: ~azure.mgmt.containerservice.models.UpgradeOverrideSettings - """ - super().__init__(**kwargs) - self.override_settings = override_settings - - -class CompatibleVersions(_serialization.Model): - """Version information about a product/service that is compatible with a service mesh revision. - - :ivar name: The product/service name. - :vartype name: str - :ivar versions: Product/service versions compatible with a service mesh add-on revision. - :vartype versions: list[str] - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "versions": {"key": "versions", "type": "[str]"}, - } - - def __init__(self, *, name: Optional[str] = None, versions: Optional[list[str]] = None, **kwargs: Any) -> None: - """ - :keyword name: The product/service name. - :paramtype name: str - :keyword versions: Product/service versions compatible with a service mesh add-on revision. - :paramtype versions: list[str] - """ - super().__init__(**kwargs) - self.name = name - self.versions = versions - - -class Component(_serialization.Model): - """Component. - - :ivar name: Component name. - :vartype name: str - :ivar version: Component version. - :vartype version: str - :ivar has_breaking_changes: If upgraded component version contains breaking changes from the - current version. To see a detailed description of what the breaking changes are, visit - https://learn.microsoft.com/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version. - :vartype has_breaking_changes: bool - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "version": {"key": "version", "type": "str"}, - "has_breaking_changes": {"key": "hasBreakingChanges", "type": "bool"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - version: Optional[str] = None, - has_breaking_changes: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Component name. - :paramtype name: str - :keyword version: Component version. - :paramtype version: str - :keyword has_breaking_changes: If upgraded component version contains breaking changes from the - current version. To see a detailed description of what the breaking changes are, visit - https://learn.microsoft.com/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version. - :paramtype has_breaking_changes: bool - """ - super().__init__(**kwargs) - self.name = name - self.version = version - self.has_breaking_changes = has_breaking_changes - - -class ComponentsByRelease(_serialization.Model): - """components of given Kubernetes version. - - :ivar kubernetes_version: The Kubernetes version (major.minor). - :vartype kubernetes_version: str - :ivar components: components of current or upgraded Kubernetes version in the cluster. - :vartype components: list[~azure.mgmt.containerservice.models.Component] - """ - - _attribute_map = { - "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, - "components": {"key": "components", "type": "[Component]"}, - } - - def __init__( - self, - *, - kubernetes_version: Optional[str] = None, - components: Optional[list["_models.Component"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword kubernetes_version: The Kubernetes version (major.minor). - :paramtype kubernetes_version: str - :keyword components: components of current or upgraded Kubernetes version in the cluster. - :paramtype components: list[~azure.mgmt.containerservice.models.Component] - """ - super().__init__(**kwargs) - self.kubernetes_version = kubernetes_version - self.components = components - - -class ContainerServiceLinuxProfile(_serialization.Model): - """Profile for Linux VMs in the container service cluster. - - All required parameters must be populated in order to send to server. - - :ivar admin_username: The administrator username to use for Linux VMs. Required. - :vartype admin_username: str - :ivar ssh: The SSH configuration for Linux-based VMs running on Azure. Required. - :vartype ssh: ~azure.mgmt.containerservice.models.ContainerServiceSshConfiguration - """ - - _validation = { - "admin_username": {"required": True, "pattern": r"^[A-Za-z][-A-Za-z0-9_]*$"}, - "ssh": {"required": True}, - } - - _attribute_map = { - "admin_username": {"key": "adminUsername", "type": "str"}, - "ssh": {"key": "ssh", "type": "ContainerServiceSshConfiguration"}, - } - - def __init__(self, *, admin_username: str, ssh: "_models.ContainerServiceSshConfiguration", **kwargs: Any) -> None: - """ - :keyword admin_username: The administrator username to use for Linux VMs. Required. - :paramtype admin_username: str - :keyword ssh: The SSH configuration for Linux-based VMs running on Azure. Required. - :paramtype ssh: ~azure.mgmt.containerservice.models.ContainerServiceSshConfiguration - """ - super().__init__(**kwargs) - self.admin_username = admin_username - self.ssh = ssh - - -class ContainerServiceNetworkProfile(_serialization.Model): - """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.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.models.NetworkPluginMode - :ivar network_policy: Network policy used for building the Kubernetes network. Known values - are: "none", "calico", "azure", and "cilium". - :vartype network_policy: str or ~azure.mgmt.containerservice.models.NetworkPolicy - :ivar network_mode: The network mode Azure CNI is configured with. 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.models.NetworkMode - :ivar network_dataplane: Network dataplane used in the Kubernetes cluster. Known values are: - "azure" and "cilium". - :vartype network_dataplane: str or ~azure.mgmt.containerservice.models.NetworkDataplane - :ivar pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :vartype pod_cidr: str - :ivar service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It must - not overlap with any Subnet IP ranges. - :vartype service_cidr: str - :ivar dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be within - the Kubernetes service address range specified in serviceCidr. - :vartype dns_service_ip: str - :ivar outbound_type: The outbound (egress) routing method. This can only be set at cluster - creation time and cannot be changed later. For more information see `egress outbound type - `_. Known values are: "loadBalancer", - "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway", and "none". - :vartype outbound_type: str or ~azure.mgmt.containerservice.models.OutboundType - :ivar load_balancer_sku: The load balancer sku for the managed cluster. 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.models.LoadBalancerSku - :ivar load_balancer_profile: Profile of the cluster load balancer. - :vartype load_balancer_profile: - ~azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfile - :ivar nat_gateway_profile: Profile of the cluster NAT gateway. - :vartype nat_gateway_profile: - ~azure.mgmt.containerservice.models.ManagedClusterNATGatewayProfile - :ivar static_egress_gateway_profile: The profile for Static Egress Gateway addon. For more - details about Static Egress Gateway, see https://aka.ms/aks/static-egress-gateway. - :vartype static_egress_gateway_profile: - ~azure.mgmt.containerservice.models.ManagedClusterStaticEgressGatewayProfile - :ivar pod_cidrs: The CIDR notation IP ranges from which to assign pod IPs. 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: The CIDR notation IP ranges from which to assign service cluster IPs. 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: The IP families used to specify IP versions available to the cluster. 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.models.IPFamily] - :ivar pod_link_local_access: Defines access to special link local addresses (Azure Instance - Metadata Service, aka IMDS) for pods with hostNetwork=false. if not specified, the default is - 'IMDS'. Known values are: "IMDS" and "None". - :vartype pod_link_local_access: str or ~azure.mgmt.containerservice.models.PodLinkLocalAccess - :ivar kube_proxy_config: Holds configuration customizations for kube-proxy. Any values not - defined will use the kube-proxy defaulting behavior. See https://v\\ - :code:``.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ - where :code:`` is represented by a :code:``-\\ :code:`` - string. Kubernetes version 1.23 would be '1-23'. - :vartype kube_proxy_config: - ~azure.mgmt.containerservice.models.ContainerServiceNetworkProfileKubeProxyConfig - :ivar advanced_networking: Advanced Networking profile for enabling observability and security - feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. - :vartype advanced_networking: ~azure.mgmt.containerservice.models.AdvancedNetworking - """ - - _validation = { - "pod_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, - "service_cidr": {"pattern": r"^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$"}, - "dns_service_ip": { - "pattern": r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$" - }, - } - - _attribute_map = { - "network_plugin": {"key": "networkPlugin", "type": "str"}, - "network_plugin_mode": {"key": "networkPluginMode", "type": "str"}, - "network_policy": {"key": "networkPolicy", "type": "str"}, - "network_mode": {"key": "networkMode", "type": "str"}, - "network_dataplane": {"key": "networkDataplane", "type": "str"}, - "pod_cidr": {"key": "podCidr", "type": "str"}, - "service_cidr": {"key": "serviceCidr", "type": "str"}, - "dns_service_ip": {"key": "dnsServiceIP", "type": "str"}, - "outbound_type": {"key": "outboundType", "type": "str"}, - "load_balancer_sku": {"key": "loadBalancerSku", "type": "str"}, - "load_balancer_profile": {"key": "loadBalancerProfile", "type": "ManagedClusterLoadBalancerProfile"}, - "nat_gateway_profile": {"key": "natGatewayProfile", "type": "ManagedClusterNATGatewayProfile"}, - "static_egress_gateway_profile": { - "key": "staticEgressGatewayProfile", - "type": "ManagedClusterStaticEgressGatewayProfile", - }, - "pod_cidrs": {"key": "podCidrs", "type": "[str]"}, - "service_cidrs": {"key": "serviceCidrs", "type": "[str]"}, - "ip_families": {"key": "ipFamilies", "type": "[str]"}, - "pod_link_local_access": {"key": "podLinkLocalAccess", "type": "str"}, - "kube_proxy_config": {"key": "kubeProxyConfig", "type": "ContainerServiceNetworkProfileKubeProxyConfig"}, - "advanced_networking": {"key": "advancedNetworking", "type": "AdvancedNetworking"}, - } - - def __init__( - self, - *, - network_plugin: Optional[Union[str, "_models.NetworkPlugin"]] = None, - network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = None, - network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = None, - network_mode: Optional[Union[str, "_models.NetworkMode"]] = None, - network_dataplane: Optional[Union[str, "_models.NetworkDataplane"]] = None, - pod_cidr: str = "10.244.0.0/16", - service_cidr: str = "10.0.0.0/16", - dns_service_ip: str = "10.0.0.10", - outbound_type: Union[str, "_models.OutboundType"] = "loadBalancer", - load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = None, - load_balancer_profile: Optional["_models.ManagedClusterLoadBalancerProfile"] = None, - nat_gateway_profile: Optional["_models.ManagedClusterNATGatewayProfile"] = None, - static_egress_gateway_profile: Optional["_models.ManagedClusterStaticEgressGatewayProfile"] = None, - pod_cidrs: Optional[list[str]] = None, - service_cidrs: Optional[list[str]] = None, - ip_families: Optional[list[Union[str, "_models.IPFamily"]]] = None, - pod_link_local_access: Optional[Union[str, "_models.PodLinkLocalAccess"]] = None, - kube_proxy_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfig"] = None, - advanced_networking: Optional["_models.AdvancedNetworking"] = None, - **kwargs: Any - ) -> None: - """ - :keyword network_plugin: Network plugin used for building the Kubernetes network. Known values - are: "azure", "kubenet", and "none". - :paramtype network_plugin: str or ~azure.mgmt.containerservice.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.models.NetworkPluginMode - :keyword network_policy: Network policy used for building the Kubernetes network. Known values - are: "none", "calico", "azure", and "cilium". - :paramtype network_policy: str or ~azure.mgmt.containerservice.models.NetworkPolicy - :keyword network_mode: The network mode Azure CNI is configured with. 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.models.NetworkMode - :keyword network_dataplane: Network dataplane used in the Kubernetes cluster. Known values are: - "azure" and "cilium". - :paramtype network_dataplane: str or ~azure.mgmt.containerservice.models.NetworkDataplane - :keyword pod_cidr: A CIDR notation IP range from which to assign pod IPs when kubenet is used. - :paramtype pod_cidr: str - :keyword service_cidr: A CIDR notation IP range from which to assign service cluster IPs. It - must not overlap with any Subnet IP ranges. - :paramtype service_cidr: str - :keyword dns_service_ip: An IP address assigned to the Kubernetes DNS service. It must be - within the Kubernetes service address range specified in serviceCidr. - :paramtype dns_service_ip: str - :keyword outbound_type: The outbound (egress) routing method. This can only be set at cluster - creation time and cannot be changed later. For more information see `egress outbound type - `_. Known values are: "loadBalancer", - "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway", and "none". - :paramtype outbound_type: str or ~azure.mgmt.containerservice.models.OutboundType - :keyword load_balancer_sku: The load balancer sku for the managed cluster. 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.models.LoadBalancerSku - :keyword load_balancer_profile: Profile of the cluster load balancer. - :paramtype load_balancer_profile: - ~azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfile - :keyword nat_gateway_profile: Profile of the cluster NAT gateway. - :paramtype nat_gateway_profile: - ~azure.mgmt.containerservice.models.ManagedClusterNATGatewayProfile - :keyword static_egress_gateway_profile: The profile for Static Egress Gateway addon. For more - details about Static Egress Gateway, see https://aka.ms/aks/static-egress-gateway. - :paramtype static_egress_gateway_profile: - ~azure.mgmt.containerservice.models.ManagedClusterStaticEgressGatewayProfile - :keyword pod_cidrs: The CIDR notation IP ranges from which to assign pod IPs. 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: The CIDR notation IP ranges from which to assign service cluster IPs. - 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: The IP families used to specify IP versions available to the cluster. 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.models.IPFamily] - :keyword pod_link_local_access: Defines access to special link local addresses (Azure Instance - Metadata Service, aka IMDS) for pods with hostNetwork=false. if not specified, the default is - 'IMDS'. Known values are: "IMDS" and "None". - :paramtype pod_link_local_access: str or ~azure.mgmt.containerservice.models.PodLinkLocalAccess - :keyword kube_proxy_config: Holds configuration customizations for kube-proxy. Any values not - defined will use the kube-proxy defaulting behavior. See https://v\\ - :code:``.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ - where :code:`` is represented by a :code:``-\\ :code:`` - string. Kubernetes version 1.23 would be '1-23'. - :paramtype kube_proxy_config: - ~azure.mgmt.containerservice.models.ContainerServiceNetworkProfileKubeProxyConfig - :keyword advanced_networking: Advanced Networking profile for enabling observability and - security feature suite on a cluster. For more information see aka.ms/aksadvancednetworking. - :paramtype advanced_networking: ~azure.mgmt.containerservice.models.AdvancedNetworking - """ - super().__init__(**kwargs) - self.network_plugin = network_plugin - self.network_plugin_mode = network_plugin_mode - self.network_policy = network_policy - self.network_mode = network_mode - self.network_dataplane = network_dataplane - self.pod_cidr = pod_cidr - self.service_cidr = service_cidr - self.dns_service_ip = dns_service_ip - self.outbound_type = outbound_type - self.load_balancer_sku = load_balancer_sku - self.load_balancer_profile = load_balancer_profile - self.nat_gateway_profile = nat_gateway_profile - self.static_egress_gateway_profile = static_egress_gateway_profile - self.pod_cidrs = pod_cidrs - self.service_cidrs = service_cidrs - self.ip_families = ip_families - self.pod_link_local_access = pod_link_local_access - self.kube_proxy_config = kube_proxy_config - self.advanced_networking = advanced_networking - - -class ContainerServiceNetworkProfileKubeProxyConfig(_serialization.Model): # pylint: disable=name-too-long - """Holds configuration customizations for kube-proxy. Any values not defined will use the - kube-proxy defaulting behavior. See https://v\\ - :code:``.docs.kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/ - where :code:`` is represented by a :code:``-\\ :code:`` - string. Kubernetes version 1.23 would be '1-23'. - - :ivar enabled: Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' exists, - kube-proxy is enabled in AKS by default without these customizations). - :vartype enabled: bool - :ivar mode: Specify which proxy mode to use ('IPTABLES', 'IPVS' or 'NFTABLES'). Known values - are: "IPTABLES", "IPVS", and "NFTABLES". - :vartype mode: str or ~azure.mgmt.containerservice.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.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "mode": {"key": "mode", "type": "str"}, - "ipvs_config": {"key": "ipvsConfig", "type": "ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig"}, - } - - def __init__( - self, - *, - enabled: Optional[bool] = None, - mode: Optional[Union[str, "_models.Mode"]] = None, - ipvs_config: Optional["_models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig"] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Whether to enable on kube-proxy on the cluster (if no 'kubeProxyConfig' - exists, kube-proxy is enabled in AKS by default without these customizations). - :paramtype enabled: bool - :keyword mode: Specify which proxy mode to use ('IPTABLES', 'IPVS' or 'NFTABLES'). Known values - are: "IPTABLES", "IPVS", and "NFTABLES". - :paramtype mode: str or ~azure.mgmt.containerservice.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.models.ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig - """ - super().__init__(**kwargs) - self.enabled = enabled - self.mode = mode - self.ipvs_config = ipvs_config - - -class ContainerServiceNetworkProfileKubeProxyConfigIpvsConfig(_serialization.Model): # pylint: disable=name-too-long - """Holds configuration customizations for IPVS. May only be specified if 'mode' is set to 'IPVS'. - - :ivar scheduler: IPVS scheduler, for more information please see - http://www.linuxvirtualserver.org/docs/scheduling.html. Known values are: "RoundRobin" and - "LeastConnection". - :vartype scheduler: str or ~azure.mgmt.containerservice.models.IpvsScheduler - :ivar tcp_timeout_seconds: The timeout value used for idle IPVS TCP sessions in seconds. Must - be a positive integer value. - :vartype tcp_timeout_seconds: int - :ivar tcp_fin_timeout_seconds: The timeout value used for IPVS TCP sessions after receiving a - FIN in seconds. Must be a positive integer value. - :vartype tcp_fin_timeout_seconds: int - :ivar udp_timeout_seconds: The timeout value used for IPVS UDP packets in seconds. Must be a - positive integer value. - :vartype udp_timeout_seconds: int - """ - - _attribute_map = { - "scheduler": {"key": "scheduler", "type": "str"}, - "tcp_timeout_seconds": {"key": "tcpTimeoutSeconds", "type": "int"}, - "tcp_fin_timeout_seconds": {"key": "tcpFinTimeoutSeconds", "type": "int"}, - "udp_timeout_seconds": {"key": "udpTimeoutSeconds", "type": "int"}, - } - - def __init__( - self, - *, - scheduler: Optional[Union[str, "_models.IpvsScheduler"]] = None, - tcp_timeout_seconds: Optional[int] = None, - tcp_fin_timeout_seconds: Optional[int] = None, - udp_timeout_seconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword scheduler: IPVS scheduler, for more information please see - http://www.linuxvirtualserver.org/docs/scheduling.html. Known values are: "RoundRobin" and - "LeastConnection". - :paramtype scheduler: str or ~azure.mgmt.containerservice.models.IpvsScheduler - :keyword tcp_timeout_seconds: The timeout value used for idle IPVS TCP sessions in seconds. - Must be a positive integer value. - :paramtype tcp_timeout_seconds: int - :keyword tcp_fin_timeout_seconds: The timeout value used for IPVS TCP sessions after receiving - a FIN in seconds. Must be a positive integer value. - :paramtype tcp_fin_timeout_seconds: int - :keyword udp_timeout_seconds: The timeout value used for IPVS UDP packets in seconds. Must be a - positive integer value. - :paramtype udp_timeout_seconds: int - """ - super().__init__(**kwargs) - self.scheduler = scheduler - self.tcp_timeout_seconds = tcp_timeout_seconds - self.tcp_fin_timeout_seconds = tcp_fin_timeout_seconds - self.udp_timeout_seconds = udp_timeout_seconds - - -class ContainerServiceSshConfiguration(_serialization.Model): - """SSH configuration for Linux-based VMs running on Azure. - - All required parameters must be populated in order to send to server. - - :ivar public_keys: The list of SSH public keys used to authenticate with Linux-based VMs. A - maximum of 1 key may be specified. Required. - :vartype public_keys: list[~azure.mgmt.containerservice.models.ContainerServiceSshPublicKey] - """ - - _validation = { - "public_keys": {"required": True}, - } - - _attribute_map = { - "public_keys": {"key": "publicKeys", "type": "[ContainerServiceSshPublicKey]"}, - } - - def __init__(self, *, public_keys: list["_models.ContainerServiceSshPublicKey"], **kwargs: Any) -> None: - """ - :keyword public_keys: The list of SSH public keys used to authenticate with Linux-based VMs. A - maximum of 1 key may be specified. Required. - :paramtype public_keys: list[~azure.mgmt.containerservice.models.ContainerServiceSshPublicKey] - """ - super().__init__(**kwargs) - self.public_keys = public_keys - - -class ContainerServiceSshPublicKey(_serialization.Model): - """Contains information about SSH certificate public key data. - - All required parameters must be populated in order to send to server. - - :ivar key_data: Certificate public key used to authenticate with VMs through SSH. The - certificate must be in PEM format with or without headers. Required. - :vartype key_data: str - """ - - _validation = { - "key_data": {"required": True}, - } - - _attribute_map = { - "key_data": {"key": "keyData", "type": "str"}, - } - - def __init__(self, *, key_data: str, **kwargs: Any) -> None: - """ - :keyword key_data: Certificate public key used to authenticate with VMs through SSH. The - certificate must be in PEM format with or without headers. Required. - :paramtype key_data: str - """ - super().__init__(**kwargs) - self.key_data = key_data - - -class CreationData(_serialization.Model): - """Data used when creating a target resource from a source resource. - - :ivar source_resource_id: This is the ARM ID of the source object to be used to create the - target object. - :vartype source_resource_id: str - """ - - _attribute_map = { - "source_resource_id": {"key": "sourceResourceId", "type": "str"}, - } - - def __init__(self, *, source_resource_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword source_resource_id: This is the ARM ID of the source object to be used to create the - target object. - :paramtype source_resource_id: str - """ - super().__init__(**kwargs) - self.source_resource_id = source_resource_id - - -class CredentialResult(_serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytes - """ - - _validation = { - "name": {"readonly": True}, - "value": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "bytearray"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.value: Optional[bytes] = 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.models.CredentialResult] - """ - - _validation = { - "kubeconfigs": {"readonly": True}, - } - - _attribute_map = { - "kubeconfigs": {"key": "kubeconfigs", "type": "[CredentialResult]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.kubeconfigs: Optional[list["_models.CredentialResult"]] = None - - -class DailySchedule(_serialization.Model): - """For schedules like: 'recur every day' or 'recur every 3 days'. - - All required parameters must be populated in order to send to server. - - :ivar interval_days: Specifies the number of days between each set of occurrences. Required. - :vartype interval_days: int - """ - - _validation = { - "interval_days": {"required": True, "maximum": 7, "minimum": 1}, - } - - _attribute_map = { - "interval_days": {"key": "intervalDays", "type": "int"}, - } - - def __init__(self, *, interval_days: int, **kwargs: Any) -> None: - """ - :keyword interval_days: Specifies the number of days between each set of occurrences. Required. - :paramtype interval_days: int - """ - super().__init__(**kwargs) - self.interval_days = interval_days - - -class DateSpan(_serialization.Model): - """A date range. For example, between '2022-12-23' and '2023-01-05'. - - All required parameters must be populated in order to send to server. - - :ivar start: The start date of the date span. Required. - :vartype start: ~datetime.date - :ivar end: The end date of the date span. Required. - :vartype end: ~datetime.date - """ - - _validation = { - "start": {"required": True}, - "end": {"required": True}, - } - - _attribute_map = { - "start": {"key": "start", "type": "date"}, - "end": {"key": "end", "type": "date"}, - } - - def __init__(self, *, start: datetime.date, end: datetime.date, **kwargs: Any) -> None: - """ - :keyword start: The start date of the date span. Required. - :paramtype start: ~datetime.date - :keyword end: The end date of the date span. Required. - :paramtype end: ~datetime.date - """ - super().__init__(**kwargs) - self.start = start - self.end = end - - -class DelegatedResource(_serialization.Model): - """Delegated resource properties - internal use only. - - :ivar resource_id: The ARM resource id of the delegated resource - internal use only. - :vartype resource_id: str - :ivar tenant_id: The tenant id of the delegated resource - internal use only. - :vartype tenant_id: str - :ivar referral_resource: The delegation id of the referral delegation (optional) - internal use - only. - :vartype referral_resource: str - :ivar location: The source resource location - internal use only. - :vartype location: str - """ - - _attribute_map = { - "resource_id": {"key": "resourceId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "referral_resource": {"key": "referralResource", "type": "str"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - tenant_id: Optional[str] = None, - referral_resource: Optional[str] = None, - location: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword resource_id: The ARM resource id of the delegated resource - internal use only. - :paramtype resource_id: str - :keyword tenant_id: The tenant id of the delegated resource - internal use only. - :paramtype tenant_id: str - :keyword referral_resource: The delegation id of the referral delegation (optional) - internal - use only. - :paramtype referral_resource: str - :keyword location: The source resource location - internal use only. - :paramtype location: str - """ - super().__init__(**kwargs) - self.resource_id = resource_id - self.tenant_id = tenant_id - self.referral_resource = referral_resource - self.location = location - - -class EndpointDependency(_serialization.Model): - """A domain name that AKS agent nodes are reaching at. - - :ivar domain_name: The domain name of the dependency. - :vartype domain_name: str - :ivar endpoint_details: The Ports and Protocols used when connecting to domainName. - :vartype endpoint_details: list[~azure.mgmt.containerservice.models.EndpointDetail] - """ - - _attribute_map = { - "domain_name": {"key": "domainName", "type": "str"}, - "endpoint_details": {"key": "endpointDetails", "type": "[EndpointDetail]"}, - } - - def __init__( - self, - *, - domain_name: Optional[str] = None, - endpoint_details: Optional[list["_models.EndpointDetail"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword domain_name: The domain name of the dependency. - :paramtype domain_name: str - :keyword endpoint_details: The Ports and Protocols used when connecting to domainName. - :paramtype endpoint_details: list[~azure.mgmt.containerservice.models.EndpointDetail] - """ - super().__init__(**kwargs) - self.domain_name = domain_name - self.endpoint_details = endpoint_details - - -class EndpointDetail(_serialization.Model): - """connect information from the AKS agent nodes to a single endpoint. - - :ivar ip_address: An IP Address that Domain Name currently resolves to. - :vartype ip_address: str - :ivar port: The port an endpoint is connected to. - :vartype port: int - :ivar protocol: The protocol used for connection. - :vartype protocol: str - :ivar description: Description of the detail. - :vartype description: str - """ - - _attribute_map = { - "ip_address": {"key": "ipAddress", "type": "str"}, - "port": {"key": "port", "type": "int"}, - "protocol": {"key": "protocol", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__( - self, - *, - ip_address: Optional[str] = None, - port: Optional[int] = None, - protocol: Optional[str] = None, - description: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword ip_address: An IP Address that Domain Name currently resolves to. - :paramtype ip_address: str - :keyword port: The port an endpoint is connected to. - :paramtype port: int - :keyword protocol: The protocol used for connection. - :paramtype protocol: str - :keyword description: Description of the detail. - :paramtype description: str - """ - super().__init__(**kwargs) - self.ip_address = ip_address - self.port = port - self.protocol = protocol - self.description = description - - -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type: Optional[str] = None - self.info: Optional[JSON] = None - - -class ErrorDetail(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.containerservice.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.containerservice.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code: Optional[str] = None - self.message: Optional[str] = None - self.target: Optional[str] = None - self.details: Optional[list["_models.ErrorDetail"]] = None - self.additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = None - - -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.containerservice.models.ErrorDetail - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.containerservice.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class ExtendedLocation(_serialization.Model): - """The complex type of the extended location. - - :ivar name: The name of the extended location. - :vartype name: str - :ivar type: The type of the extended location. "EdgeZone" - :vartype type: str or ~azure.mgmt.containerservice.models.ExtendedLocationTypes - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - type: Optional[Union[str, "_models.ExtendedLocationTypes"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The name of the extended location. - :paramtype name: str - :keyword type: The type of the extended location. "EdgeZone" - :paramtype type: str or ~azure.mgmt.containerservice.models.ExtendedLocationTypes - """ - super().__init__(**kwargs) - self.name = name - self.type = type - - -class GPUProfile(_serialization.Model): - """GPUProfile. - - :ivar driver: Whether to install GPU drivers. When it's not specified, default is Install. - Known values are: "Install" and "None". - :vartype driver: str or ~azure.mgmt.containerservice.models.GPUDriver - :ivar driver_type: Specify the type of GPU driver to install when creating Windows agent pools. - If not provided, AKS selects the driver based on system compatibility. This cannot be changed - once the AgentPool has been created. This cannot be set on Linux AgentPools. For Linux - AgentPools, the driver is selected based on system compatibility. Known values are: "GRID" and - "CUDA". - :vartype driver_type: str or ~azure.mgmt.containerservice.models.DriverType - """ - - _attribute_map = { - "driver": {"key": "driver", "type": "str"}, - "driver_type": {"key": "driverType", "type": "str"}, - } - - def __init__( - self, - *, - driver: Optional[Union[str, "_models.GPUDriver"]] = None, - driver_type: Optional[Union[str, "_models.DriverType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword driver: Whether to install GPU drivers. When it's not specified, default is Install. - Known values are: "Install" and "None". - :paramtype driver: str or ~azure.mgmt.containerservice.models.GPUDriver - :keyword driver_type: Specify the type of GPU driver to install when creating Windows agent - pools. If not provided, AKS selects the driver based on system compatibility. This cannot be - changed once the AgentPool has been created. This cannot be set on Linux AgentPools. For Linux - AgentPools, the driver is selected based on system compatibility. Known values are: "GRID" and - "CUDA". - :paramtype driver_type: str or ~azure.mgmt.containerservice.models.DriverType - """ - super().__init__(**kwargs) - self.driver = driver - self.driver_type = driver_type - - -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - self.system_data: Optional["_models.SystemData"] = None - - -class GuardrailsAvailableVersion(Resource): - """Available Guardrails Version. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - :ivar properties: Whether the version is default or not and support info. Required. - :vartype properties: ~azure.mgmt.containerservice.models.GuardrailsAvailableVersionsProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "properties": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "GuardrailsAvailableVersionsProperties"}, - } - - def __init__(self, *, properties: "_models.GuardrailsAvailableVersionsProperties", **kwargs: Any) -> None: - """ - :keyword properties: Whether the version is default or not and support info. Required. - :paramtype properties: - ~azure.mgmt.containerservice.models.GuardrailsAvailableVersionsProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class GuardrailsAvailableVersionsList(_serialization.Model): - """Hold values properties, which is array of GuardrailsVersions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of AKS supported Guardrails versions. - :vartype value: list[~azure.mgmt.containerservice.models.GuardrailsAvailableVersion] - :ivar next_link: The URL to get the next Guardrails available version. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[GuardrailsAvailableVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.GuardrailsAvailableVersion"]] = None, **kwargs: Any) -> None: - """ - :keyword value: Array of AKS supported Guardrails versions. - :paramtype value: list[~azure.mgmt.containerservice.models.GuardrailsAvailableVersion] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class GuardrailsAvailableVersionsProperties(_serialization.Model): - """Whether the version is default or not and support info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar is_default_version: - :vartype is_default_version: bool - :ivar support: Whether the version is preview or stable. Known values are: "Preview" and - "Stable". - :vartype support: str or ~azure.mgmt.containerservice.models.GuardrailsSupport - """ - - _validation = { - "is_default_version": {"readonly": True}, - "support": {"readonly": True}, - } - - _attribute_map = { - "is_default_version": {"key": "isDefaultVersion", "type": "bool"}, - "support": {"key": "support", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.is_default_version: Optional[bool] = None - self.support: Optional[Union[str, "_models.GuardrailsSupport"]] = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - """ - - -class IdentityBinding(ProxyResource): - """The IdentityBinding resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.containerservice.models.SystemData - :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.containerservice.models.IdentityBindingProperties - :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value - will change when the resource is updated. Specify an if-match or if-none-match header with the - eTag value for a subsequent request to enable optimistic concurrency per the normal eTag - convention. - :vartype e_tag: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "e_tag": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "IdentityBindingProperties"}, - "e_tag": {"key": "eTag", "type": "str"}, - } - - def __init__(self, *, properties: Optional["_models.IdentityBindingProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: The resource-specific properties for this resource. - :paramtype properties: ~azure.mgmt.containerservice.models.IdentityBindingProperties - """ - super().__init__(**kwargs) - self.properties = properties - self.e_tag: Optional[str] = None - - -class IdentityBindingListResult(_serialization.Model): - """The response of a IdentityBinding list operation. - - All required parameters must be populated in order to send to server. - - :ivar value: The IdentityBinding items on this page. Required. - :vartype value: list[~azure.mgmt.containerservice.models.IdentityBinding] - :ivar next_link: The link to the next page of items. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[IdentityBinding]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, *, value: list["_models.IdentityBinding"], next_link: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword value: The IdentityBinding items on this page. Required. - :paramtype value: list[~azure.mgmt.containerservice.models.IdentityBinding] - :keyword next_link: The link to the next page of items. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class IdentityBindingManagedIdentityProfile(_serialization.Model): - """Managed identity profile for the identity binding. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar resource_id: The resource ID of the managed identity. Required. - :vartype resource_id: str - :ivar object_id: The object ID of the managed identity. - :vartype object_id: str - :ivar client_id: The client ID of the managed identity. - :vartype client_id: str - :ivar tenant_id: The tenant ID of the managed identity. - :vartype tenant_id: str - """ - - _validation = { - "resource_id": {"required": True}, - "object_id": { - "readonly": True, - "max_length": 36, - "min_length": 36, - "pattern": r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - }, - "client_id": { - "readonly": True, - "max_length": 36, - "min_length": 36, - "pattern": r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - }, - "tenant_id": { - "readonly": True, - "max_length": 36, - "min_length": 36, - "pattern": r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$", - }, - } - - _attribute_map = { - "resource_id": {"key": "resourceId", "type": "str"}, - "object_id": {"key": "objectId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - } - - def __init__(self, *, resource_id: str, **kwargs: Any) -> None: - """ - :keyword resource_id: The resource ID of the managed identity. Required. - :paramtype resource_id: str - """ - super().__init__(**kwargs) - self.resource_id = resource_id - self.object_id: Optional[str] = None - self.client_id: Optional[str] = None - self.tenant_id: Optional[str] = None - - -class IdentityBindingOidcIssuerProfile(_serialization.Model): - """IdentityBinding OIDC issuer profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar oidc_issuer_url: The OIDC issuer URL of the IdentityBinding. - :vartype oidc_issuer_url: str - """ - - _validation = { - "oidc_issuer_url": {"readonly": True}, - } - - _attribute_map = { - "oidc_issuer_url": {"key": "oidcIssuerUrl", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.oidc_issuer_url: Optional[str] = None - - -class IdentityBindingProperties(_serialization.Model): - """IdentityBinding properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar managed_identity: Managed identity profile for the identity binding. Required. - :vartype managed_identity: - ~azure.mgmt.containerservice.models.IdentityBindingManagedIdentityProfile - :ivar oidc_issuer: The OIDC issuer URL of the IdentityBinding. - :vartype oidc_issuer: ~azure.mgmt.containerservice.models.IdentityBindingOidcIssuerProfile - :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", - "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.models.IdentityBindingProvisioningState - """ - - _validation = { - "managed_identity": {"required": True}, - "oidc_issuer": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "managed_identity": {"key": "managedIdentity", "type": "IdentityBindingManagedIdentityProfile"}, - "oidc_issuer": {"key": "oidcIssuer", "type": "IdentityBindingOidcIssuerProfile"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__(self, *, managed_identity: "_models.IdentityBindingManagedIdentityProfile", **kwargs: Any) -> None: - """ - :keyword managed_identity: Managed identity profile for the identity binding. Required. - :paramtype managed_identity: - ~azure.mgmt.containerservice.models.IdentityBindingManagedIdentityProfile - """ - super().__init__(**kwargs) - self.managed_identity = managed_identity - self.oidc_issuer: Optional["_models.IdentityBindingOidcIssuerProfile"] = None - self.provisioning_state: Optional[Union[str, "_models.IdentityBindingProvisioningState"]] = None - - -class IPTag(_serialization.Model): - """Contains the IPTag associated with the object. - - :ivar ip_tag_type: The IP tag type. Example: RoutingPreference. - :vartype ip_tag_type: str - :ivar tag: The value of the IP tag associated with the public IP. Example: Internet. - :vartype tag: str - """ - - _attribute_map = { - "ip_tag_type": {"key": "ipTagType", "type": "str"}, - "tag": {"key": "tag", "type": "str"}, - } - - def __init__(self, *, ip_tag_type: Optional[str] = None, tag: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword ip_tag_type: The IP tag type. Example: RoutingPreference. - :paramtype ip_tag_type: str - :keyword tag: The value of the IP tag associated with the public IP. Example: Internet. - :paramtype tag: str - """ - super().__init__(**kwargs) - self.ip_tag_type = ip_tag_type - self.tag = tag - - -class IstioCertificateAuthority(_serialization.Model): - """Istio Service Mesh Certificate Authority (CA) configuration. For now, we only support plugin - certificates as described here https://aka.ms/asm-plugin-ca. - - :ivar plugin: Plugin certificates information for Service Mesh. - :vartype plugin: ~azure.mgmt.containerservice.models.IstioPluginCertificateAuthority - """ - - _attribute_map = { - "plugin": {"key": "plugin", "type": "IstioPluginCertificateAuthority"}, - } - - def __init__(self, *, plugin: Optional["_models.IstioPluginCertificateAuthority"] = None, **kwargs: Any) -> None: - """ - :keyword plugin: Plugin certificates information for Service Mesh. - :paramtype plugin: ~azure.mgmt.containerservice.models.IstioPluginCertificateAuthority - """ - super().__init__(**kwargs) - self.plugin = plugin - - -class IstioComponents(_serialization.Model): - """Istio components configuration. - - :ivar ingress_gateways: Istio ingress gateways. - :vartype ingress_gateways: list[~azure.mgmt.containerservice.models.IstioIngressGateway] - :ivar egress_gateways: Istio egress gateways. - :vartype egress_gateways: list[~azure.mgmt.containerservice.models.IstioEgressGateway] - :ivar proxy_redirection_mechanism: Mode of traffic redirection. Known values are: - "InitContainers" and "CNIChaining". - :vartype proxy_redirection_mechanism: str or - ~azure.mgmt.containerservice.models.ProxyRedirectionMechanism - """ - - _attribute_map = { - "ingress_gateways": {"key": "ingressGateways", "type": "[IstioIngressGateway]"}, - "egress_gateways": {"key": "egressGateways", "type": "[IstioEgressGateway]"}, - "proxy_redirection_mechanism": {"key": "proxyRedirectionMechanism", "type": "str"}, - } - - def __init__( - self, - *, - ingress_gateways: Optional[list["_models.IstioIngressGateway"]] = None, - egress_gateways: Optional[list["_models.IstioEgressGateway"]] = None, - proxy_redirection_mechanism: Optional[Union[str, "_models.ProxyRedirectionMechanism"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword ingress_gateways: Istio ingress gateways. - :paramtype ingress_gateways: list[~azure.mgmt.containerservice.models.IstioIngressGateway] - :keyword egress_gateways: Istio egress gateways. - :paramtype egress_gateways: list[~azure.mgmt.containerservice.models.IstioEgressGateway] - :keyword proxy_redirection_mechanism: Mode of traffic redirection. Known values are: - "InitContainers" and "CNIChaining". - :paramtype proxy_redirection_mechanism: str or - ~azure.mgmt.containerservice.models.ProxyRedirectionMechanism - """ - super().__init__(**kwargs) - self.ingress_gateways = ingress_gateways - self.egress_gateways = egress_gateways - self.proxy_redirection_mechanism = proxy_redirection_mechanism - - -class IstioEgressGateway(_serialization.Model): - """Istio egress gateway configuration. - - All required parameters must be populated in order to send to server. - - :ivar enabled: Whether to enable the egress gateway. Required. - :vartype enabled: bool - :ivar name: Name of the Istio add-on egress gateway. Required. - :vartype name: str - :ivar namespace: Namespace that the Istio add-on egress gateway should be deployed in. If - unspecified, the default is aks-istio-egress. - :vartype namespace: str - :ivar gateway_configuration_name: Name of the gateway configuration custom resource for the - Istio add-on egress gateway. Must be specified when enabling the Istio egress gateway. Must be - deployed in the same namespace that the Istio egress gateway will be deployed in. - :vartype gateway_configuration_name: str - """ - - _validation = { - "enabled": {"required": True}, - "name": {"required": True, "pattern": r"[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*"}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "name": {"key": "name", "type": "str"}, - "namespace": {"key": "namespace", "type": "str"}, - "gateway_configuration_name": {"key": "gatewayConfigurationName", "type": "str"}, - } - - def __init__( - self, - *, - enabled: bool, - name: str, - namespace: Optional[str] = None, - gateway_configuration_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Whether to enable the egress gateway. Required. - :paramtype enabled: bool - :keyword name: Name of the Istio add-on egress gateway. Required. - :paramtype name: str - :keyword namespace: Namespace that the Istio add-on egress gateway should be deployed in. If - unspecified, the default is aks-istio-egress. - :paramtype namespace: str - :keyword gateway_configuration_name: Name of the gateway configuration custom resource for the - Istio add-on egress gateway. Must be specified when enabling the Istio egress gateway. Must be - deployed in the same namespace that the Istio egress gateway will be deployed in. - :paramtype gateway_configuration_name: str - """ - super().__init__(**kwargs) - self.enabled = enabled - self.name = name - self.namespace = namespace - self.gateway_configuration_name = gateway_configuration_name - - -class IstioIngressGateway(_serialization.Model): - """Istio ingress gateway configuration. For now, we support up to one external ingress gateway - named ``aks-istio-ingressgateway-external`` and one internal ingress gateway named - ``aks-istio-ingressgateway-internal``. - - All required parameters must be populated in order to send to server. - - :ivar mode: Mode of an ingress gateway. Required. Known values are: "External" and "Internal". - :vartype mode: str or ~azure.mgmt.containerservice.models.IstioIngressGatewayMode - :ivar enabled: Whether to enable the ingress gateway. Required. - :vartype enabled: bool - """ - - _validation = { - "mode": {"required": True}, - "enabled": {"required": True}, - } - - _attribute_map = { - "mode": {"key": "mode", "type": "str"}, - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, mode: Union[str, "_models.IstioIngressGatewayMode"], enabled: bool, **kwargs: Any) -> None: - """ - :keyword mode: Mode of an ingress gateway. Required. Known values are: "External" and - "Internal". - :paramtype mode: str or ~azure.mgmt.containerservice.models.IstioIngressGatewayMode - :keyword enabled: Whether to enable the ingress gateway. Required. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.mode = mode - self.enabled = enabled - - -class IstioPluginCertificateAuthority(_serialization.Model): - """Plugin certificates information for Service Mesh. - - :ivar key_vault_id: The resource ID of the Key Vault. - :vartype key_vault_id: str - :ivar cert_object_name: Intermediate certificate object name in Azure Key Vault. - :vartype cert_object_name: str - :ivar key_object_name: Intermediate certificate private key object name in Azure Key Vault. - :vartype key_object_name: str - :ivar root_cert_object_name: Root certificate object name in Azure Key Vault. - :vartype root_cert_object_name: str - :ivar cert_chain_object_name: Certificate chain object name in Azure Key Vault. - :vartype cert_chain_object_name: str - """ - - _attribute_map = { - "key_vault_id": {"key": "keyVaultId", "type": "str"}, - "cert_object_name": {"key": "certObjectName", "type": "str"}, - "key_object_name": {"key": "keyObjectName", "type": "str"}, - "root_cert_object_name": {"key": "rootCertObjectName", "type": "str"}, - "cert_chain_object_name": {"key": "certChainObjectName", "type": "str"}, - } - - def __init__( - self, - *, - key_vault_id: Optional[str] = None, - cert_object_name: Optional[str] = None, - key_object_name: Optional[str] = None, - root_cert_object_name: Optional[str] = None, - cert_chain_object_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword key_vault_id: The resource ID of the Key Vault. - :paramtype key_vault_id: str - :keyword cert_object_name: Intermediate certificate object name in Azure Key Vault. - :paramtype cert_object_name: str - :keyword key_object_name: Intermediate certificate private key object name in Azure Key Vault. - :paramtype key_object_name: str - :keyword root_cert_object_name: Root certificate object name in Azure Key Vault. - :paramtype root_cert_object_name: str - :keyword cert_chain_object_name: Certificate chain object name in Azure Key Vault. - :paramtype cert_chain_object_name: str - """ - super().__init__(**kwargs) - self.key_vault_id = key_vault_id - self.cert_object_name = cert_object_name - self.key_object_name = key_object_name - self.root_cert_object_name = root_cert_object_name - self.cert_chain_object_name = cert_chain_object_name - - -class IstioServiceMesh(_serialization.Model): - """Istio service mesh configuration. - - :ivar components: Istio components configuration. - :vartype components: ~azure.mgmt.containerservice.models.IstioComponents - :ivar certificate_authority: Istio Service Mesh Certificate Authority (CA) configuration. For - now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. - :vartype certificate_authority: ~azure.mgmt.containerservice.models.IstioCertificateAuthority - :ivar revisions: The list of revisions of the Istio control plane. When an upgrade is not in - progress, this holds one value. When canary upgrade is in progress, this can only hold two - consecutive values. For more information, see: - https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. - :vartype revisions: list[str] - """ - - _validation = { - "revisions": {"max_items": 2, "min_items": 0, "unique": True}, - } - - _attribute_map = { - "components": {"key": "components", "type": "IstioComponents"}, - "certificate_authority": {"key": "certificateAuthority", "type": "IstioCertificateAuthority"}, - "revisions": {"key": "revisions", "type": "[str]"}, - } - - def __init__( - self, - *, - components: Optional["_models.IstioComponents"] = None, - certificate_authority: Optional["_models.IstioCertificateAuthority"] = None, - revisions: Optional[list[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword components: Istio components configuration. - :paramtype components: ~azure.mgmt.containerservice.models.IstioComponents - :keyword certificate_authority: Istio Service Mesh Certificate Authority (CA) configuration. - For now, we only support plugin certificates as described here https://aka.ms/asm-plugin-ca. - :paramtype certificate_authority: ~azure.mgmt.containerservice.models.IstioCertificateAuthority - :keyword revisions: The list of revisions of the Istio control plane. When an upgrade is not in - progress, this holds one value. When canary upgrade is in progress, this can only hold two - consecutive values. For more information, see: - https://learn.microsoft.com/en-us/azure/aks/istio-upgrade. - :paramtype revisions: list[str] - """ - super().__init__(**kwargs) - self.components = components - self.certificate_authority = certificate_authority - self.revisions = revisions - - -class JWTAuthenticator(ProxyResource): - """Configuration for JWT authenticator in the managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.containerservice.models.SystemData - :ivar properties: The properties of JWTAuthenticator. For details on how to configure the - properties of a JWT authenticator, please refer to the Kubernetes documentation: - https://kubernetes.io/docs/reference/access-authn-authz/authentication/#using-authentication-configuration. - Please note that not all fields available in the Kubernetes documentation are supported by AKS. - For troubleshooting, please see https://aka.ms/aks-external-issuers-docs. Required. - :vartype properties: ~azure.mgmt.containerservice.models.JWTAuthenticatorProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "properties": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "JWTAuthenticatorProperties"}, - } - - def __init__(self, *, properties: "_models.JWTAuthenticatorProperties", **kwargs: Any) -> None: - """ - :keyword properties: The properties of JWTAuthenticator. For details on how to configure the - properties of a JWT authenticator, please refer to the Kubernetes documentation: - https://kubernetes.io/docs/reference/access-authn-authz/authentication/#using-authentication-configuration. - Please note that not all fields available in the Kubernetes documentation are supported by AKS. - For troubleshooting, please see https://aka.ms/aks-external-issuers-docs. Required. - :paramtype properties: ~azure.mgmt.containerservice.models.JWTAuthenticatorProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class JWTAuthenticatorClaimMappingExpression(_serialization.Model): - """The claim mapping expression for JWTAuthenticator. - - All required parameters must be populated in order to send to server. - - :ivar expression: The CEL expression used to access token claims. Required. - :vartype expression: str - """ - - _validation = { - "expression": {"required": True}, - } - - _attribute_map = { - "expression": {"key": "expression", "type": "str"}, - } - - def __init__(self, *, expression: str, **kwargs: Any) -> None: - """ - :keyword expression: The CEL expression used to access token claims. Required. - :paramtype expression: str - """ - super().__init__(**kwargs) - self.expression = expression - - -class JWTAuthenticatorClaimMappings(_serialization.Model): - """The claim mappings for JWTAuthenticator. - - All required parameters must be populated in order to send to server. - - :ivar username: The expression to extract username attribute from the token claims. Required. - :vartype username: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression - :ivar groups: The expression to extract groups attribute from the token claims. When not - provided, no groups are extracted from the token claims. - :vartype groups: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression - :ivar uid: The expression to extract uid attribute from the token claims. When not provided, no - uid is extracted from the token claims. - :vartype uid: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression - :ivar extra: The expression to extract extra attribute from the token claims. When not - provided, no extra attributes are extracted from the token claims. - :vartype extra: - list[~azure.mgmt.containerservice.models.JWTAuthenticatorExtraClaimMappingExpression] - """ - - _validation = { - "username": {"required": True}, - } - - _attribute_map = { - "username": {"key": "username", "type": "JWTAuthenticatorClaimMappingExpression"}, - "groups": {"key": "groups", "type": "JWTAuthenticatorClaimMappingExpression"}, - "uid": {"key": "uid", "type": "JWTAuthenticatorClaimMappingExpression"}, - "extra": {"key": "extra", "type": "[JWTAuthenticatorExtraClaimMappingExpression]"}, - } - - def __init__( - self, - *, - username: "_models.JWTAuthenticatorClaimMappingExpression", - groups: Optional["_models.JWTAuthenticatorClaimMappingExpression"] = None, - uid: Optional["_models.JWTAuthenticatorClaimMappingExpression"] = None, - extra: Optional[list["_models.JWTAuthenticatorExtraClaimMappingExpression"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword username: The expression to extract username attribute from the token claims. - Required. - :paramtype username: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression - :keyword groups: The expression to extract groups attribute from the token claims. When not - provided, no groups are extracted from the token claims. - :paramtype groups: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression - :keyword uid: The expression to extract uid attribute from the token claims. When not provided, - no uid is extracted from the token claims. - :paramtype uid: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappingExpression - :keyword extra: The expression to extract extra attribute from the token claims. When not - provided, no extra attributes are extracted from the token claims. - :paramtype extra: - list[~azure.mgmt.containerservice.models.JWTAuthenticatorExtraClaimMappingExpression] - """ - super().__init__(**kwargs) - self.username = username - self.groups = groups - self.uid = uid - self.extra = extra - - -class JWTAuthenticatorExtraClaimMappingExpression(_serialization.Model): # pylint: disable=name-too-long - """The extra claim mapping expression for JWTAuthenticator. - - All required parameters must be populated in order to send to server. - - :ivar key: The key of the extra attribute. Required. - :vartype key: str - :ivar value_expression: The CEL expression used to extract the value of the extra attribute. - Required. - :vartype value_expression: str - """ - - _validation = { - "key": {"required": True}, - "value_expression": {"required": True}, - } - - _attribute_map = { - "key": {"key": "key", "type": "str"}, - "value_expression": {"key": "valueExpression", "type": "str"}, - } - - def __init__(self, *, key: str, value_expression: str, **kwargs: Any) -> None: - """ - :keyword key: The key of the extra attribute. Required. - :paramtype key: str - :keyword value_expression: The CEL expression used to extract the value of the extra attribute. - Required. - :paramtype value_expression: str - """ - super().__init__(**kwargs) - self.key = key - self.value_expression = value_expression - - -class JWTAuthenticatorIssuer(_serialization.Model): - """The OIDC issuer details for JWTAuthenticator. - - All required parameters must be populated in order to send to server. - - :ivar url: The issuer URL. The URL must begin with the scheme https and cannot contain a query - string or fragment. This must match the "iss" claim in the presented JWT, and the issuer - returned from discovery. Required. - :vartype url: str - :ivar audiences: The set of acceptable audiences the JWT must be issued to. At least one is - required. When multiple is set, AudienceMatchPolicy is used in API Server configuration. - Required. - :vartype audiences: list[str] - """ - - _validation = { - "url": {"required": True}, - "audiences": {"required": True, "min_items": 1}, - } - - _attribute_map = { - "url": {"key": "url", "type": "str"}, - "audiences": {"key": "audiences", "type": "[str]"}, - } - - def __init__(self, *, url: str, audiences: list[str], **kwargs: Any) -> None: - """ - :keyword url: The issuer URL. The URL must begin with the scheme https and cannot contain a - query string or fragment. This must match the "iss" claim in the presented JWT, and the issuer - returned from discovery. Required. - :paramtype url: str - :keyword audiences: The set of acceptable audiences the JWT must be issued to. At least one is - required. When multiple is set, AudienceMatchPolicy is used in API Server configuration. - Required. - :paramtype audiences: list[str] - """ - super().__init__(**kwargs) - self.url = url - self.audiences = audiences - - -class JWTAuthenticatorListResult(_serialization.Model): - """The response from the List JWT authenticator operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: The list of JWT authenticators. Required. - :vartype value: list[~azure.mgmt.containerservice.models.JWTAuthenticator] - :ivar next_link: The URL to get the next set of JWT authenticator results. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[JWTAuthenticator]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: list["_models.JWTAuthenticator"], **kwargs: Any) -> None: - """ - :keyword value: The list of JWT authenticators. Required. - :paramtype value: list[~azure.mgmt.containerservice.models.JWTAuthenticator] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class JWTAuthenticatorProperties(_serialization.Model): - """The properties of JWTAuthenticator. For details on how to configure the properties of a JWT - authenticator, please refer to the Kubernetes documentation: - https://kubernetes.io/docs/reference/access-authn-authz/authentication/#using-authentication-configuration. - Please note that not all fields available in the Kubernetes documentation are supported by AKS. - For troubleshooting, please see https://aka.ms/aks-external-issuers-docs. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar provisioning_state: The current provisioning state of the JWT authenticator. Known values - are: "Succeeded", "Failed", "Canceled", "Creating", "Updating", and "Deleting". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.models.JWTAuthenticatorProvisioningState - :ivar issuer: The JWT OIDC issuer details. Required. - :vartype issuer: ~azure.mgmt.containerservice.models.JWTAuthenticatorIssuer - :ivar claim_validation_rules: The rules that are applied to validate token claims to - authenticate users. All the expressions must evaluate to true for validation to succeed. - :vartype claim_validation_rules: - list[~azure.mgmt.containerservice.models.JWTAuthenticatorValidationRule] - :ivar claim_mappings: The mappings that define how user attributes are extracted from the token - claims. Required. - :vartype claim_mappings: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappings - :ivar user_validation_rules: The rules that are applied to the mapped user before completing - authentication. All the expressions must evaluate to true for validation to succeed. - :vartype user_validation_rules: - list[~azure.mgmt.containerservice.models.JWTAuthenticatorValidationRule] - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "issuer": {"required": True}, - "claim_mappings": {"required": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "issuer": {"key": "issuer", "type": "JWTAuthenticatorIssuer"}, - "claim_validation_rules": {"key": "claimValidationRules", "type": "[JWTAuthenticatorValidationRule]"}, - "claim_mappings": {"key": "claimMappings", "type": "JWTAuthenticatorClaimMappings"}, - "user_validation_rules": {"key": "userValidationRules", "type": "[JWTAuthenticatorValidationRule]"}, - } - - def __init__( - self, - *, - issuer: "_models.JWTAuthenticatorIssuer", - claim_mappings: "_models.JWTAuthenticatorClaimMappings", - claim_validation_rules: Optional[list["_models.JWTAuthenticatorValidationRule"]] = None, - user_validation_rules: Optional[list["_models.JWTAuthenticatorValidationRule"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword issuer: The JWT OIDC issuer details. Required. - :paramtype issuer: ~azure.mgmt.containerservice.models.JWTAuthenticatorIssuer - :keyword claim_validation_rules: The rules that are applied to validate token claims to - authenticate users. All the expressions must evaluate to true for validation to succeed. - :paramtype claim_validation_rules: - list[~azure.mgmt.containerservice.models.JWTAuthenticatorValidationRule] - :keyword claim_mappings: The mappings that define how user attributes are extracted from the - token claims. Required. - :paramtype claim_mappings: ~azure.mgmt.containerservice.models.JWTAuthenticatorClaimMappings - :keyword user_validation_rules: The rules that are applied to the mapped user before completing - authentication. All the expressions must evaluate to true for validation to succeed. - :paramtype user_validation_rules: - list[~azure.mgmt.containerservice.models.JWTAuthenticatorValidationRule] - """ - super().__init__(**kwargs) - self.provisioning_state: Optional[Union[str, "_models.JWTAuthenticatorProvisioningState"]] = None - self.issuer = issuer - self.claim_validation_rules = claim_validation_rules - self.claim_mappings = claim_mappings - self.user_validation_rules = user_validation_rules - - -class JWTAuthenticatorValidationRule(_serialization.Model): - """The validation rule for JWTAuthenticator. - - All required parameters must be populated in order to send to server. - - :ivar expression: The CEL expression used to validate the claim or attribute. Required. - :vartype expression: str - :ivar message: The validation error message. - :vartype message: str - """ - - _validation = { - "expression": {"required": True}, - } - - _attribute_map = { - "expression": {"key": "expression", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, *, expression: str, message: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword expression: The CEL expression used to validate the claim or attribute. Required. - :paramtype expression: str - :keyword message: The validation error message. - :paramtype message: str - """ - super().__init__(**kwargs) - self.expression = expression - self.message = message - - -class KubeletConfig(_serialization.Model): - """Kubelet configurations of agent nodes. See `AKS custom node configuration - `_ for more details. - - :ivar cpu_manager_policy: The CPU Manager policy to use. 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: If CPU CFS quota enforcement is enabled for containers that specify CPU - limits. The default is true. - :vartype cpu_cfs_quota: bool - :ivar cpu_cfs_quota_period: The CPU CFS quota period value. 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: The percent of disk usage after which image garbage collection - is always run. To disable image garbage collection, set to 100. The default is 85%. - :vartype image_gc_high_threshold: int - :ivar image_gc_low_threshold: The percent of disk usage before which image garbage collection - is never run. This cannot be set higher than imageGcHighThreshold. The default is 80%. - :vartype image_gc_low_threshold: int - :ivar topology_manager_policy: The Topology Manager policy to use. 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 - :ivar seccomp_default: Specifies the default seccomp profile applied to all workloads. If not - specified, 'Unconfined' will be used by default. Known values are: "Unconfined" and - "RuntimeDefault". - :vartype seccomp_default: str or ~azure.mgmt.containerservice.models.SeccompDefault - """ - - _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"}, - "seccomp_default": {"key": "seccompDefault", "type": "str"}, - } - - 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, - seccomp_default: Optional[Union[str, "_models.SeccompDefault"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword cpu_manager_policy: The CPU Manager policy to use. 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: If CPU CFS quota enforcement is enabled for containers that specify CPU - limits. The default is true. - :paramtype cpu_cfs_quota: bool - :keyword cpu_cfs_quota_period: The CPU CFS quota period value. 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: The percent of disk usage after which image garbage - collection is always run. To disable image garbage collection, set to 100. The default is 85%. - :paramtype image_gc_high_threshold: int - :keyword image_gc_low_threshold: The percent of disk usage before which image garbage - collection is never run. This cannot be set higher than imageGcHighThreshold. The default is - 80%. - :paramtype image_gc_low_threshold: int - :keyword topology_manager_policy: The Topology Manager policy to use. 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 - :keyword seccomp_default: Specifies the default seccomp profile applied to all workloads. If - not specified, 'Unconfined' will be used by default. Known values are: "Unconfined" and - "RuntimeDefault". - :paramtype seccomp_default: str or ~azure.mgmt.containerservice.models.SeccompDefault - """ - 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 - self.seccomp_default = seccomp_default - - -class KubernetesPatchVersion(_serialization.Model): - """Kubernetes patch version profile. - - :ivar upgrades: Possible upgrade path for given patch version. - :vartype upgrades: list[str] - """ - - _attribute_map = { - "upgrades": {"key": "upgrades", "type": "[str]"}, - } - - def __init__(self, *, upgrades: Optional[list[str]] = None, **kwargs: Any) -> None: - """ - :keyword upgrades: Possible upgrade path for given patch version. - :paramtype upgrades: list[str] - """ - super().__init__(**kwargs) - self.upgrades = upgrades - - -class KubernetesResourceObjectEncryptionProfile(_serialization.Model): # pylint: disable=name-too-long - """Encryption at rest of Kubernetes resource objects using service-managed keys. More information - on this can be found under https://aka.ms/aks/kubernetesResourceObjectEncryption. - - :ivar infrastructure_encryption: Whether to enable encryption at rest of Kubernetes resource - objects using service-managed keys. More information on this can be found under - https://aka.ms/aks/kubernetesResourceObjectEncryption. Known values are: "Enabled" and - "Disabled". - :vartype infrastructure_encryption: str or - ~azure.mgmt.containerservice.models.InfrastructureEncryption - """ - - _attribute_map = { - "infrastructure_encryption": {"key": "infrastructureEncryption", "type": "str"}, - } - - def __init__( - self, *, infrastructure_encryption: Union[str, "_models.InfrastructureEncryption"] = "Disabled", **kwargs: Any - ) -> None: - """ - :keyword infrastructure_encryption: Whether to enable encryption at rest of Kubernetes resource - objects using service-managed keys. More information on this can be found under - https://aka.ms/aks/kubernetesResourceObjectEncryption. Known values are: "Enabled" and - "Disabled". - :paramtype infrastructure_encryption: str or - ~azure.mgmt.containerservice.models.InfrastructureEncryption - """ - super().__init__(**kwargs) - self.infrastructure_encryption = infrastructure_encryption - - -class KubernetesVersion(_serialization.Model): - """Kubernetes version profile for given major.minor release. - - :ivar version: major.minor version of Kubernetes release. - :vartype version: str - :ivar capabilities: Capabilities on this Kubernetes version. - :vartype capabilities: ~azure.mgmt.containerservice.models.KubernetesVersionCapabilities - :ivar is_default: Whether this version is default. - :vartype is_default: bool - :ivar is_preview: Whether this version is in preview mode. - :vartype is_preview: bool - :ivar patch_versions: Patch versions of Kubernetes release. - :vartype patch_versions: dict[str, ~azure.mgmt.containerservice.models.KubernetesPatchVersion] - """ - - _attribute_map = { - "version": {"key": "version", "type": "str"}, - "capabilities": {"key": "capabilities", "type": "KubernetesVersionCapabilities"}, - "is_default": {"key": "isDefault", "type": "bool"}, - "is_preview": {"key": "isPreview", "type": "bool"}, - "patch_versions": {"key": "patchVersions", "type": "{KubernetesPatchVersion}"}, - } - - def __init__( - self, - *, - version: Optional[str] = None, - capabilities: Optional["_models.KubernetesVersionCapabilities"] = None, - is_default: Optional[bool] = None, - is_preview: Optional[bool] = None, - patch_versions: Optional[dict[str, "_models.KubernetesPatchVersion"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword version: major.minor version of Kubernetes release. - :paramtype version: str - :keyword capabilities: Capabilities on this Kubernetes version. - :paramtype capabilities: ~azure.mgmt.containerservice.models.KubernetesVersionCapabilities - :keyword is_default: Whether this version is default. - :paramtype is_default: bool - :keyword is_preview: Whether this version is in preview mode. - :paramtype is_preview: bool - :keyword patch_versions: Patch versions of Kubernetes release. - :paramtype patch_versions: dict[str, - ~azure.mgmt.containerservice.models.KubernetesPatchVersion] - """ - super().__init__(**kwargs) - self.version = version - self.capabilities = capabilities - self.is_default = is_default - self.is_preview = is_preview - self.patch_versions = patch_versions - - -class KubernetesVersionCapabilities(_serialization.Model): - """Capabilities on this Kubernetes version. - - :ivar support_plan: - :vartype support_plan: list[str or ~azure.mgmt.containerservice.models.KubernetesSupportPlan] - """ - - _attribute_map = { - "support_plan": {"key": "supportPlan", "type": "[str]"}, - } - - def __init__( - self, *, support_plan: Optional[list[Union[str, "_models.KubernetesSupportPlan"]]] = None, **kwargs: Any - ) -> None: - """ - :keyword support_plan: - :paramtype support_plan: list[str or ~azure.mgmt.containerservice.models.KubernetesSupportPlan] - """ - super().__init__(**kwargs) - self.support_plan = support_plan - - -class KubernetesVersionListResult(_serialization.Model): - """Hold values properties, which is array of KubernetesVersion. - - :ivar values: Array of AKS supported Kubernetes versions. - :vartype values: list[~azure.mgmt.containerservice.models.KubernetesVersion] - """ - - _attribute_map = { - "values": {"key": "values", "type": "[KubernetesVersion]"}, - } - - def __init__(self, *, values: Optional[list["_models.KubernetesVersion"]] = None, **kwargs: Any) -> None: - """ - :keyword values: Array of AKS supported Kubernetes versions. - :paramtype values: list[~azure.mgmt.containerservice.models.KubernetesVersion] - """ - super().__init__(**kwargs) - self.values = values - - -class LabelSelector(_serialization.Model): - """A label selector is a label query over a set of resources. The result of matchLabels and - matchExpressions are ANDed. An empty label selector matches all objects. A null label selector - matches no objects. - - :ivar match_labels: matchLabels is an array of {key=value} pairs. A single {key=value} in the - matchLabels map is equivalent to an element of matchExpressions, whose key field is ``key``\\ , - the operator is ``In``\\ , and the values array contains only ``value``. The requirements are - ANDed. - :vartype match_labels: list[str] - :ivar match_expressions: matchExpressions is a list of label selector requirements. The - requirements are ANDed. - :vartype match_expressions: list[~azure.mgmt.containerservice.models.LabelSelectorRequirement] - """ - - _attribute_map = { - "match_labels": {"key": "matchLabels", "type": "[str]"}, - "match_expressions": {"key": "matchExpressions", "type": "[LabelSelectorRequirement]"}, - } - - def __init__( - self, - *, - match_labels: Optional[list[str]] = None, - match_expressions: Optional[list["_models.LabelSelectorRequirement"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword match_labels: matchLabels is an array of {key=value} pairs. A single {key=value} in - the matchLabels map is equivalent to an element of matchExpressions, whose key field is - ``key``\\ , the operator is ``In``\\ , and the values array contains only ``value``. The - requirements are ANDed. - :paramtype match_labels: list[str] - :keyword match_expressions: matchExpressions is a list of label selector requirements. The - requirements are ANDed. - :paramtype match_expressions: - list[~azure.mgmt.containerservice.models.LabelSelectorRequirement] - """ - super().__init__(**kwargs) - self.match_labels = match_labels - self.match_expressions = match_expressions - - -class LabelSelectorRequirement(_serialization.Model): - """A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - - :ivar key: key is the label key that the selector applies to. - :vartype key: str - :ivar operator: operator represents a key's relationship to a set of values. Valid operators - are In and NotIn. Known values are: "In", "NotIn", "Exists", "DoesNotExist", and "In". - :vartype operator: str or ~azure.mgmt.containerservice.models.Operator - :ivar values: values is an array of string values, the values array must be non-empty. - :vartype values: list[str] - """ - - _attribute_map = { - "key": {"key": "key", "type": "str"}, - "operator": {"key": "operator", "type": "str"}, - "values": {"key": "values", "type": "[str]"}, - } - - def __init__( - self, - *, - key: Optional[str] = None, - operator: Optional[Union[str, "_models.Operator"]] = None, - values: Optional[list[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword key: key is the label key that the selector applies to. - :paramtype key: str - :keyword operator: operator represents a key's relationship to a set of values. Valid operators - are In and NotIn. Known values are: "In", "NotIn", "Exists", "DoesNotExist", and "In". - :paramtype operator: str or ~azure.mgmt.containerservice.models.Operator - :keyword values: values is an array of string values, the values array must be non-empty. - :paramtype values: list[str] - """ - super().__init__(**kwargs) - self.key = key - self.operator = operator - self.values = values - - -class LinuxOSConfig(_serialization.Model): - """OS configurations of Linux agent nodes. See `AKS custom node configuration - `_ for more details. - - :ivar sysctls: Sysctl settings for Linux agent nodes. - :vartype sysctls: ~azure.mgmt.containerservice.models.SysctlConfig - :ivar transparent_huge_page_enabled: Whether transparent hugepages are 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: Whether the kernel should make aggressive use of memory - compaction to make more hugepages available. Valid values are 'always', 'defer', - 'defer+madvise', 'madvise' and 'never'. The default is 'madvise'. For more information see - `Transparent Hugepages - `_. - :vartype transparent_huge_page_defrag: str - :ivar swap_file_size_mb: The size in MB of a swap file that will be created on each node. - :vartype swap_file_size_mb: int - """ - - _attribute_map = { - "sysctls": {"key": "sysctls", "type": "SysctlConfig"}, - "transparent_huge_page_enabled": {"key": "transparentHugePageEnabled", "type": "str"}, - "transparent_huge_page_defrag": {"key": "transparentHugePageDefrag", "type": "str"}, - "swap_file_size_mb": {"key": "swapFileSizeMB", "type": "int"}, - } - - def __init__( - self, - *, - sysctls: Optional["_models.SysctlConfig"] = None, - transparent_huge_page_enabled: Optional[str] = None, - transparent_huge_page_defrag: Optional[str] = None, - swap_file_size_mb: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword sysctls: Sysctl settings for Linux agent nodes. - :paramtype sysctls: ~azure.mgmt.containerservice.models.SysctlConfig - :keyword transparent_huge_page_enabled: Whether transparent hugepages are 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: Whether the kernel should make aggressive use of memory - compaction to make more hugepages available. 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 LoadBalancer(ProxyResource): - """The configurations regarding multiple standard load balancers. If not supplied, single load - balancer mode will be used. Multiple standard load balancers mode will be used if at lease one - configuration is supplied. There has to be a configuration named ``kubernetes``. The name field - will be the name of the corresponding public load balancer. There will be an internal load - balancer created if needed, and the name will be ``-internal``. The internal lb shares - the same configurations as the external one. The internal lbs are not needed to be included in - LoadBalancer list. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.containerservice.models.SystemData - :ivar primary_agent_pool_name: Required field. A string value that must specify the ID of an - existing agent pool. All nodes in the given pool will always be added to this load balancer. - This agent pool must have at least one node and minCount>=1 for autoscaling operations. An - agent pool can only be the primary pool for a single load balancer. - :vartype primary_agent_pool_name: str - :ivar allow_service_placement: Whether to automatically place services on the load balancer. If - not supplied, the default value is true. If set to false manually, both of the external and the - internal load balancer will not be selected for services unless they explicitly target it. - :vartype allow_service_placement: bool - :ivar service_label_selector: Only services that must match this selector can be placed on this - load balancer. - :vartype service_label_selector: ~azure.mgmt.containerservice.models.LabelSelector - :ivar service_namespace_selector: Services created in namespaces that match the selector can be - placed on this load balancer. - :vartype service_namespace_selector: ~azure.mgmt.containerservice.models.LabelSelector - :ivar node_selector: Nodes that match this selector will be possible members of this load - balancer. - :vartype node_selector: ~azure.mgmt.containerservice.models.LabelSelector - :ivar provisioning_state: The current provisioning state. - :vartype provisioning_state: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "primary_agent_pool_name": {"key": "properties.primaryAgentPoolName", "type": "str"}, - "allow_service_placement": {"key": "properties.allowServicePlacement", "type": "bool"}, - "service_label_selector": {"key": "properties.serviceLabelSelector", "type": "LabelSelector"}, - "service_namespace_selector": {"key": "properties.serviceNamespaceSelector", "type": "LabelSelector"}, - "node_selector": {"key": "properties.nodeSelector", "type": "LabelSelector"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - primary_agent_pool_name: Optional[str] = None, - allow_service_placement: Optional[bool] = None, - service_label_selector: Optional["_models.LabelSelector"] = None, - service_namespace_selector: Optional["_models.LabelSelector"] = None, - node_selector: Optional["_models.LabelSelector"] = None, - **kwargs: Any - ) -> None: - """ - :keyword primary_agent_pool_name: Required field. A string value that must specify the ID of an - existing agent pool. All nodes in the given pool will always be added to this load balancer. - This agent pool must have at least one node and minCount>=1 for autoscaling operations. An - agent pool can only be the primary pool for a single load balancer. - :paramtype primary_agent_pool_name: str - :keyword allow_service_placement: Whether to automatically place services on the load balancer. - If not supplied, the default value is true. If set to false manually, both of the external and - the internal load balancer will not be selected for services unless they explicitly target it. - :paramtype allow_service_placement: bool - :keyword service_label_selector: Only services that must match this selector can be placed on - this load balancer. - :paramtype service_label_selector: ~azure.mgmt.containerservice.models.LabelSelector - :keyword service_namespace_selector: Services created in namespaces that match the selector can - be placed on this load balancer. - :paramtype service_namespace_selector: ~azure.mgmt.containerservice.models.LabelSelector - :keyword node_selector: Nodes that match this selector will be possible members of this load - balancer. - :paramtype node_selector: ~azure.mgmt.containerservice.models.LabelSelector - """ - super().__init__(**kwargs) - self.primary_agent_pool_name = primary_agent_pool_name - self.allow_service_placement = allow_service_placement - self.service_label_selector = service_label_selector - self.service_namespace_selector = service_namespace_selector - self.node_selector = node_selector - self.provisioning_state: Optional[str] = None - - -class LoadBalancerListResult(_serialization.Model): - """The response from the List Load Balancers operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Load Balancers. - :vartype value: list[~azure.mgmt.containerservice.models.LoadBalancer] - :ivar next_link: The URL to get the next set of load balancer results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[LoadBalancer]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.LoadBalancer"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of Load Balancers. - :paramtype value: list[~azure.mgmt.containerservice.models.LoadBalancer] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class LocalDNSOverride(_serialization.Model): - """Overrides for localDNS profile. - - :ivar query_logging: Log level for DNS queries in localDNS. Known values are: "Error" and - "Log". - :vartype query_logging: str or ~azure.mgmt.containerservice.models.LocalDNSQueryLogging - :ivar protocol: Enforce TCP or prefer UDP protocol for connections from localDNS to upstream - DNS server. Known values are: "PreferUDP" and "ForceTCP". - :vartype protocol: str or ~azure.mgmt.containerservice.models.LocalDNSProtocol - :ivar forward_destination: Destination server for DNS queries to be forwarded from localDNS. - Known values are: "ClusterCoreDNS" and "VnetDNS". - :vartype forward_destination: str or - ~azure.mgmt.containerservice.models.LocalDNSForwardDestination - :ivar forward_policy: Forward policy for selecting upstream DNS server. See `forward plugin - `_ for more information. Known values are: "Sequential", - "RoundRobin", and "Random". - :vartype forward_policy: str or ~azure.mgmt.containerservice.models.LocalDNSForwardPolicy - :ivar max_concurrent: Maximum number of concurrent queries. See `forward plugin - `_ for more information. - :vartype max_concurrent: int - :ivar cache_duration_in_seconds: Cache max TTL in seconds. See `cache plugin - `_ for more information. - :vartype cache_duration_in_seconds: int - :ivar serve_stale_duration_in_seconds: Serve stale duration in seconds. See `cache plugin - `_ for more information. - :vartype serve_stale_duration_in_seconds: int - :ivar serve_stale: Policy for serving stale data. See `cache plugin - `_ for more information. Known values are: "Verify", - "Immediate", and "Disable". - :vartype serve_stale: str or ~azure.mgmt.containerservice.models.LocalDNSServeStale - """ - - _attribute_map = { - "query_logging": {"key": "queryLogging", "type": "str"}, - "protocol": {"key": "protocol", "type": "str"}, - "forward_destination": {"key": "forwardDestination", "type": "str"}, - "forward_policy": {"key": "forwardPolicy", "type": "str"}, - "max_concurrent": {"key": "maxConcurrent", "type": "int"}, - "cache_duration_in_seconds": {"key": "cacheDurationInSeconds", "type": "int"}, - "serve_stale_duration_in_seconds": {"key": "serveStaleDurationInSeconds", "type": "int"}, - "serve_stale": {"key": "serveStale", "type": "str"}, - } - - def __init__( - self, - *, - query_logging: Union[str, "_models.LocalDNSQueryLogging"] = "Error", - protocol: Union[str, "_models.LocalDNSProtocol"] = "PreferUDP", - forward_destination: Union[str, "_models.LocalDNSForwardDestination"] = "ClusterCoreDNS", - forward_policy: Union[str, "_models.LocalDNSForwardPolicy"] = "Sequential", - max_concurrent: int = 1000, - cache_duration_in_seconds: int = 3600, - serve_stale_duration_in_seconds: int = 3600, - serve_stale: Union[str, "_models.LocalDNSServeStale"] = "Immediate", - **kwargs: Any - ) -> None: - """ - :keyword query_logging: Log level for DNS queries in localDNS. Known values are: "Error" and - "Log". - :paramtype query_logging: str or ~azure.mgmt.containerservice.models.LocalDNSQueryLogging - :keyword protocol: Enforce TCP or prefer UDP protocol for connections from localDNS to upstream - DNS server. Known values are: "PreferUDP" and "ForceTCP". - :paramtype protocol: str or ~azure.mgmt.containerservice.models.LocalDNSProtocol - :keyword forward_destination: Destination server for DNS queries to be forwarded from localDNS. - Known values are: "ClusterCoreDNS" and "VnetDNS". - :paramtype forward_destination: str or - ~azure.mgmt.containerservice.models.LocalDNSForwardDestination - :keyword forward_policy: Forward policy for selecting upstream DNS server. See `forward plugin - `_ for more information. Known values are: "Sequential", - "RoundRobin", and "Random". - :paramtype forward_policy: str or ~azure.mgmt.containerservice.models.LocalDNSForwardPolicy - :keyword max_concurrent: Maximum number of concurrent queries. See `forward plugin - `_ for more information. - :paramtype max_concurrent: int - :keyword cache_duration_in_seconds: Cache max TTL in seconds. See `cache plugin - `_ for more information. - :paramtype cache_duration_in_seconds: int - :keyword serve_stale_duration_in_seconds: Serve stale duration in seconds. See `cache plugin - `_ for more information. - :paramtype serve_stale_duration_in_seconds: int - :keyword serve_stale: Policy for serving stale data. See `cache plugin - `_ for more information. Known values are: "Verify", - "Immediate", and "Disable". - :paramtype serve_stale: str or ~azure.mgmt.containerservice.models.LocalDNSServeStale - """ - super().__init__(**kwargs) - self.query_logging = query_logging - self.protocol = protocol - self.forward_destination = forward_destination - self.forward_policy = forward_policy - self.max_concurrent = max_concurrent - self.cache_duration_in_seconds = cache_duration_in_seconds - self.serve_stale_duration_in_seconds = serve_stale_duration_in_seconds - self.serve_stale = serve_stale - - -class LocalDNSProfile(_serialization.Model): - """Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. LocalDNS helps improve - performance and reliability of DNS resolution in an AKS cluster. For more details see - aka.ms/aks/localdns. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar mode: Mode of enablement for localDNS. Known values are: "Preferred", "Required", and - "Disabled". - :vartype mode: str or ~azure.mgmt.containerservice.models.LocalDNSMode - :ivar state: System-generated state of localDNS. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.containerservice.models.LocalDNSState - :ivar vnet_dns_overrides: VnetDNS overrides apply to DNS traffic from pods with - dnsPolicy:default or kubelet (referred to as VnetDNS traffic). - :vartype vnet_dns_overrides: dict[str, ~azure.mgmt.containerservice.models.LocalDNSOverride] - :ivar kube_dns_overrides: KubeDNS overrides apply to DNS traffic from pods with - dnsPolicy:ClusterFirst (referred to as KubeDNS traffic). - :vartype kube_dns_overrides: dict[str, ~azure.mgmt.containerservice.models.LocalDNSOverride] - """ - - _validation = { - "state": {"readonly": True}, - } - - _attribute_map = { - "mode": {"key": "mode", "type": "str"}, - "state": {"key": "state", "type": "str"}, - "vnet_dns_overrides": {"key": "vnetDNSOverrides", "type": "{LocalDNSOverride}"}, - "kube_dns_overrides": {"key": "kubeDNSOverrides", "type": "{LocalDNSOverride}"}, - } - - def __init__( - self, - *, - mode: Union[str, "_models.LocalDNSMode"] = "Preferred", - vnet_dns_overrides: Optional[dict[str, "_models.LocalDNSOverride"]] = None, - kube_dns_overrides: Optional[dict[str, "_models.LocalDNSOverride"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword mode: Mode of enablement for localDNS. Known values are: "Preferred", "Required", and - "Disabled". - :paramtype mode: str or ~azure.mgmt.containerservice.models.LocalDNSMode - :keyword vnet_dns_overrides: VnetDNS overrides apply to DNS traffic from pods with - dnsPolicy:default or kubelet (referred to as VnetDNS traffic). - :paramtype vnet_dns_overrides: dict[str, ~azure.mgmt.containerservice.models.LocalDNSOverride] - :keyword kube_dns_overrides: KubeDNS overrides apply to DNS traffic from pods with - dnsPolicy:ClusterFirst (referred to as KubeDNS traffic). - :paramtype kube_dns_overrides: dict[str, ~azure.mgmt.containerservice.models.LocalDNSOverride] - """ - super().__init__(**kwargs) - self.mode = mode - self.state: Optional[Union[str, "_models.LocalDNSState"]] = None - self.vnet_dns_overrides = vnet_dns_overrides - self.kube_dns_overrides = kube_dns_overrides - - -class Machine(SubResource): - """A machine provides detailed information about its configuration and status. A machine may be - visible here but not in kubectl get nodes; if so, it may be because the machine has not been - registered with the Kubernetes API Server yet. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar zones: The Availability zone in which machine is located. - :vartype zones: list[str] - :ivar properties: The properties of the machine. - :vartype properties: ~azure.mgmt.containerservice.models.MachineProperties - """ - - _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"}, - "zones": {"key": "zones", "type": "[str]"}, - "properties": {"key": "properties", "type": "MachineProperties"}, - } - - def __init__( - self, - *, - zones: Optional[list[str]] = None, - properties: Optional["_models.MachineProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword zones: The Availability zone in which machine is located. - :paramtype zones: list[str] - :keyword properties: The properties of the machine. - :paramtype properties: ~azure.mgmt.containerservice.models.MachineProperties - """ - super().__init__(**kwargs) - self.zones = zones - self.properties = properties - - -class MachineHardwareProfile(_serialization.Model): - """The hardware and GPU settings of the machine. - - :ivar vm_size: The size of the VM. 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 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.models.GPUInstanceProfile - :ivar gpu_profile: The GPU settings of the machine. - :vartype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile - """ - - _attribute_map = { - "vm_size": {"key": "vmSize", "type": "str"}, - "gpu_instance_profile": {"key": "gpuInstanceProfile", "type": "str"}, - "gpu_profile": {"key": "gpuProfile", "type": "GPUProfile"}, - } - - def __init__( - self, - *, - vm_size: Optional[str] = None, - gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, - gpu_profile: Optional["_models.GPUProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword vm_size: The size of the VM. 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 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.models.GPUInstanceProfile - :keyword gpu_profile: The GPU settings of the machine. - :paramtype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile - """ - super().__init__(**kwargs) - self.vm_size = vm_size - self.gpu_instance_profile = gpu_instance_profile - self.gpu_profile = gpu_profile - - -class MachineIpAddress(_serialization.Model): - """The machine IP address details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar family: To determine if address belongs IPv4 or IPv6 family. Known values are: "IPv4" and - "IPv6". - :vartype family: str or ~azure.mgmt.containerservice.models.IPFamily - :ivar ip: IPv4 or IPv6 address of the machine. - :vartype ip: str - """ - - _validation = { - "family": {"readonly": True}, - "ip": {"readonly": True}, - } - - _attribute_map = { - "family": {"key": "family", "type": "str"}, - "ip": {"key": "ip", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.family: Optional[Union[str, "_models.IPFamily"]] = None - self.ip: Optional[str] = None - - -class MachineKubernetesProfile(_serialization.Model): - """The Kubernetes configurations used by the machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar node_labels: The node labels on the machine. - :vartype node_labels: dict[str, str] - :ivar orchestrator_version: The version of Kubernetes specified by the user. Both patch version - and are supported. When is specified, the - latest supported patch version is chosen automatically. - :vartype orchestrator_version: str - :ivar current_orchestrator_version: The version of Kubernetes running on the machine. 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 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.models.KubeletDiskType - :ivar kubelet_config: The Kubelet configuration on the machine. - :vartype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig - :ivar node_initialization_taints: Taints added on the node during creation that will not be - reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl - call. These taints allow for required configuration to run before the node is ready to accept - workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl taint - nodes node1 key1=value1:NoSchedule-``. - :vartype node_initialization_taints: list[str] - :ivar node_taints: The taints added to new node during machine create. For example, - key=value:NoSchedule. - :vartype node_taints: list[str] - :ivar max_pods: The maximum number of pods that can run on a node. - :vartype max_pods: int - :ivar node_name: The node name in the Kubernetes cluster. - :vartype node_name: str - :ivar workload_runtime: Determines the type of workload a node can run. Known values are: - "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". - :vartype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime - :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. - :vartype artifact_streaming_profile: - ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile - """ - - _validation = { - "current_orchestrator_version": {"readonly": True}, - "node_name": {"readonly": True}, - } - - _attribute_map = { - "node_labels": {"key": "nodeLabels", "type": "{str}"}, - "orchestrator_version": {"key": "orchestratorVersion", "type": "str"}, - "current_orchestrator_version": {"key": "currentOrchestratorVersion", "type": "str"}, - "kubelet_disk_type": {"key": "kubeletDiskType", "type": "str"}, - "kubelet_config": {"key": "kubeletConfig", "type": "KubeletConfig"}, - "node_initialization_taints": {"key": "nodeInitializationTaints", "type": "[str]"}, - "node_taints": {"key": "nodeTaints", "type": "[str]"}, - "max_pods": {"key": "maxPods", "type": "int"}, - "node_name": {"key": "nodeName", "type": "str"}, - "workload_runtime": {"key": "workloadRuntime", "type": "str"}, - "artifact_streaming_profile": {"key": "artifactStreamingProfile", "type": "AgentPoolArtifactStreamingProfile"}, - } - - def __init__( - self, - *, - node_labels: Optional[dict[str, str]] = None, - orchestrator_version: Optional[str] = None, - kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, - kubelet_config: Optional["_models.KubeletConfig"] = None, - node_initialization_taints: Optional[list[str]] = None, - node_taints: Optional[list[str]] = None, - max_pods: Optional[int] = None, - workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, - artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword node_labels: The node labels on the machine. - :paramtype node_labels: dict[str, str] - :keyword orchestrator_version: The version of Kubernetes specified by the user. Both patch - version and are supported. When is specified, - the latest supported patch version is chosen automatically. - :paramtype orchestrator_version: str - :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.models.KubeletDiskType - :keyword kubelet_config: The Kubelet configuration on the machine. - :paramtype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig - :keyword node_initialization_taints: Taints added on the node during creation that will not be - reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl - call. These taints allow for required configuration to run before the node is ready to accept - workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl taint - nodes node1 key1=value1:NoSchedule-``. - :paramtype node_initialization_taints: list[str] - :keyword node_taints: The taints added to new node during machine create. For example, - key=value:NoSchedule. - :paramtype node_taints: list[str] - :keyword max_pods: The maximum number of pods that can run on a node. - :paramtype max_pods: int - :keyword workload_runtime: Determines the type of workload a node can run. Known values are: - "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". - :paramtype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime - :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. - :paramtype artifact_streaming_profile: - ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile - """ - super().__init__(**kwargs) - self.node_labels = node_labels - self.orchestrator_version = orchestrator_version - self.current_orchestrator_version: Optional[str] = None - self.kubelet_disk_type = kubelet_disk_type - self.kubelet_config = kubelet_config - self.node_initialization_taints = node_initialization_taints - self.node_taints = node_taints - self.max_pods = max_pods - self.node_name: Optional[str] = None - self.workload_runtime = workload_runtime - self.artifact_streaming_profile = artifact_streaming_profile - - -class MachineListResult(_serialization.Model): - """The response from the List Machines operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of Machines in cluster. - :vartype value: list[~azure.mgmt.containerservice.models.Machine] - :ivar next_link: The URL to get the next set of machine results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Machine]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.Machine"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of Machines in cluster. - :paramtype value: list[~azure.mgmt.containerservice.models.Machine] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class MachineNetworkProperties(_serialization.Model): - """The network properties of the machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar ip_addresses: IPv4, IPv6 addresses of the machine. - :vartype ip_addresses: list[~azure.mgmt.containerservice.models.MachineIpAddress] - :ivar vnet_subnet_id: The ID of the subnet which node and optionally pods will join on startup. - 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: The ID of the subnet which pods will join when launched. 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 enable_node_public_ip: Whether the machine is allocated its own public IP. Some scenarios - may require the machine 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. The default is false. - :vartype enable_node_public_ip: bool - :ivar node_public_ip_prefix_id: The public IP prefix ID which VM node should use IPs from. This - is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :vartype node_public_ip_prefix_id: str - :ivar node_public_ip_tags: IPTags of instance-level public IPs. - :vartype node_public_ip_tags: list[~azure.mgmt.containerservice.models.IPTag] - """ - - _validation = { - "ip_addresses": {"readonly": True}, - } - - _attribute_map = { - "ip_addresses": {"key": "ipAddresses", "type": "[MachineIpAddress]"}, - "vnet_subnet_id": {"key": "vnetSubnetID", "type": "str"}, - "pod_subnet_id": {"key": "podSubnetID", "type": "str"}, - "enable_node_public_ip": {"key": "enableNodePublicIP", "type": "bool"}, - "node_public_ip_prefix_id": {"key": "nodePublicIPPrefixID", "type": "str"}, - "node_public_ip_tags": {"key": "nodePublicIPTags", "type": "[IPTag]"}, - } - - def __init__( - self, - *, - vnet_subnet_id: Optional[str] = None, - pod_subnet_id: Optional[str] = None, - enable_node_public_ip: Optional[bool] = None, - node_public_ip_prefix_id: Optional[str] = None, - node_public_ip_tags: Optional[list["_models.IPTag"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword vnet_subnet_id: The ID of the subnet which node and optionally pods will join on - startup. 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: The ID of the subnet which pods will join when launched. 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 enable_node_public_ip: Whether the machine is allocated its own public IP. Some - scenarios may require the machine 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. The default is false. - :paramtype enable_node_public_ip: bool - :keyword node_public_ip_prefix_id: The public IP prefix ID which VM node should use IPs from. - This is of the form: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}. - :paramtype node_public_ip_prefix_id: str - :keyword node_public_ip_tags: IPTags of instance-level public IPs. - :paramtype node_public_ip_tags: list[~azure.mgmt.containerservice.models.IPTag] - """ - super().__init__(**kwargs) - self.ip_addresses: Optional[list["_models.MachineIpAddress"]] = None - self.vnet_subnet_id = vnet_subnet_id - self.pod_subnet_id = pod_subnet_id - self.enable_node_public_ip = enable_node_public_ip - self.node_public_ip_prefix_id = node_public_ip_prefix_id - self.node_public_ip_tags = node_public_ip_tags - - -class MachineOSProfile(_serialization.Model): - """The operating system and disk used by the machine. - - :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.models.OSType - :ivar os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is - Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be - changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", - "AzureLinux", "AzureLinux3", "Flatcar", "CBLMariner", "Windows2019", "Windows2022", - "Windows2025", "WindowsAnnual", "Ubuntu2204", and "Ubuntu2404". - :vartype os_sku: str or ~azure.mgmt.containerservice.models.OSSKU - :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 OS disk type to be used for machines in the agent pool. 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.models.OSDiskType - :ivar enable_fips: Whether to use a FIPS-enabled OS. - :vartype enable_fips: bool - :ivar linux_profile: The Linux machine's specific profile. - :vartype linux_profile: ~azure.mgmt.containerservice.models.MachineOSProfileLinuxProfile - :ivar windows_profile: The Windows machine's specific profile. - :vartype windows_profile: ~azure.mgmt.containerservice.models.AgentPoolWindowsProfile - """ - - _validation = { - "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, - } - - _attribute_map = { - "os_type": {"key": "osType", "type": "str"}, - "os_sku": {"key": "osSKU", "type": "str"}, - "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, - "os_disk_type": {"key": "osDiskType", "type": "str"}, - "enable_fips": {"key": "enableFIPS", "type": "bool"}, - "linux_profile": {"key": "linuxProfile", "type": "MachineOSProfileLinuxProfile"}, - "windows_profile": {"key": "windowsProfile", "type": "AgentPoolWindowsProfile"}, - } - - def __init__( - self, - *, - os_type: Union[str, "_models.OSType"] = "Linux", - os_sku: Optional[Union[str, "_models.OSSKU"]] = None, - os_disk_size_gb: Optional[int] = None, - os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, - enable_fips: Optional[bool] = None, - linux_profile: Optional["_models.MachineOSProfileLinuxProfile"] = None, - windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, - **kwargs: Any - ) -> None: - """ - :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.models.OSType - :keyword os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is - Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be - changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", - "AzureLinux", "AzureLinux3", "Flatcar", "CBLMariner", "Windows2019", "Windows2022", - "Windows2025", "WindowsAnnual", "Ubuntu2204", and "Ubuntu2404". - :paramtype os_sku: str or ~azure.mgmt.containerservice.models.OSSKU - :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 OS disk type to be used for machines in the agent pool. 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.models.OSDiskType - :keyword enable_fips: Whether to use a FIPS-enabled OS. - :paramtype enable_fips: bool - :keyword linux_profile: The Linux machine's specific profile. - :paramtype linux_profile: ~azure.mgmt.containerservice.models.MachineOSProfileLinuxProfile - :keyword windows_profile: The Windows machine's specific profile. - :paramtype windows_profile: ~azure.mgmt.containerservice.models.AgentPoolWindowsProfile - """ - super().__init__(**kwargs) - self.os_type = os_type - self.os_sku = os_sku - self.os_disk_size_gb = os_disk_size_gb - self.os_disk_type = os_disk_type - self.enable_fips = enable_fips - self.linux_profile = linux_profile - self.windows_profile = windows_profile - - -class MachineOSProfileLinuxProfile(_serialization.Model): - """The Linux machine's specific profile. - - :ivar linux_os_config: The OS configuration of Linux machine. - :vartype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig - :ivar message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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 - """ - - _attribute_map = { - "linux_os_config": {"key": "linuxOSConfig", "type": "LinuxOSConfig"}, - "message_of_the_day": {"key": "messageOfTheDay", "type": "str"}, - } - - def __init__( - self, - *, - linux_os_config: Optional["_models.LinuxOSConfig"] = None, - message_of_the_day: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword linux_os_config: The OS configuration of Linux machine. - :paramtype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig - :keyword message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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 - """ - super().__init__(**kwargs) - self.linux_os_config = linux_os_config - self.message_of_the_day = message_of_the_day - - -class MachineProperties(_serialization.Model): - """The properties of the machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar network: The network properties of the machine. - :vartype network: ~azure.mgmt.containerservice.models.MachineNetworkProperties - :ivar resource_id: Arm resource id of the machine. It can be used to GET underlying VM - Instance. - :vartype resource_id: str - :ivar hardware: The hardware and GPU settings of the machine. - :vartype hardware: ~azure.mgmt.containerservice.models.MachineHardwareProfile - :ivar operating_system: The operating system and disk used by the machine. - :vartype operating_system: ~azure.mgmt.containerservice.models.MachineOSProfile - :ivar kubernetes: The Kubernetes configurations used by the machine. - :vartype kubernetes: ~azure.mgmt.containerservice.models.MachineKubernetesProfile - :ivar mode: Machine only allows 'System' and 'User' mode. Known values are: "System", "User", - "Gateway", "ManagedSystem", and "Machines". - :vartype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode - :ivar security: The security settings of the machine. - :vartype security: ~azure.mgmt.containerservice.models.MachineSecurityProfile - :ivar priority: The priority for the machine. If not specified, the default is 'Regular'. Known - values are: "Spot" and "Regular". - :vartype priority: str or ~azure.mgmt.containerservice.models.ScaleSetPriority - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar tags: The tags to be persisted on the machine. - :vartype tags: dict[str, str] - :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value - will change when the resource is updated. Specify an if-match or if-none-match header with the - eTag value for a subsequent request to enable optimistic concurrency per the normal eTag - convention. - :vartype e_tag: str - :ivar status: Contains read-only information about the machine. - :vartype status: ~azure.mgmt.containerservice.models.MachineStatus - """ - - _validation = { - "resource_id": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "e_tag": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "network": {"key": "network", "type": "MachineNetworkProperties"}, - "resource_id": {"key": "resourceId", "type": "str"}, - "hardware": {"key": "hardware", "type": "MachineHardwareProfile"}, - "operating_system": {"key": "operatingSystem", "type": "MachineOSProfile"}, - "kubernetes": {"key": "kubernetes", "type": "MachineKubernetesProfile"}, - "mode": {"key": "mode", "type": "str"}, - "security": {"key": "security", "type": "MachineSecurityProfile"}, - "priority": {"key": "priority", "type": "str"}, - "node_image_version": {"key": "nodeImageVersion", "type": "str"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "e_tag": {"key": "eTag", "type": "str"}, - "status": {"key": "status", "type": "MachineStatus"}, - } - - def __init__( - self, - *, - network: Optional["_models.MachineNetworkProperties"] = None, - hardware: Optional["_models.MachineHardwareProfile"] = None, - operating_system: Optional["_models.MachineOSProfile"] = None, - kubernetes: Optional["_models.MachineKubernetesProfile"] = None, - mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, - security: Optional["_models.MachineSecurityProfile"] = None, - priority: Union[str, "_models.ScaleSetPriority"] = "Regular", - node_image_version: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword network: The network properties of the machine. - :paramtype network: ~azure.mgmt.containerservice.models.MachineNetworkProperties - :keyword hardware: The hardware and GPU settings of the machine. - :paramtype hardware: ~azure.mgmt.containerservice.models.MachineHardwareProfile - :keyword operating_system: The operating system and disk used by the machine. - :paramtype operating_system: ~azure.mgmt.containerservice.models.MachineOSProfile - :keyword kubernetes: The Kubernetes configurations used by the machine. - :paramtype kubernetes: ~azure.mgmt.containerservice.models.MachineKubernetesProfile - :keyword mode: Machine only allows 'System' and 'User' mode. Known values are: "System", - "User", "Gateway", "ManagedSystem", and "Machines". - :paramtype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode - :keyword security: The security settings of the machine. - :paramtype security: ~azure.mgmt.containerservice.models.MachineSecurityProfile - :keyword priority: The priority for the machine. If not specified, the default is 'Regular'. - Known values are: "Spot" and "Regular". - :paramtype priority: str or ~azure.mgmt.containerservice.models.ScaleSetPriority - :keyword node_image_version: The version of node image. - :paramtype node_image_version: str - :keyword tags: The tags to be persisted on the machine. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.network = network - self.resource_id: Optional[str] = None - self.hardware = hardware - self.operating_system = operating_system - self.kubernetes = kubernetes - self.mode = mode - self.security = security - self.priority = priority - self.node_image_version = node_image_version - self.provisioning_state: Optional[str] = None - self.tags = tags - self.e_tag: Optional[str] = None - self.status: Optional["_models.MachineStatus"] = None - - -class MachineSecurityProfile(_serialization.Model): - """The security settings of the machine. - - :ivar ssh_access: SSH access method of an agent pool. Known values are: "LocalUser", - "Disabled", and "EntraId". - :vartype ssh_access: str or ~azure.mgmt.containerservice.models.AgentPoolSSHAccess - :ivar enable_vtpm: vTPM is a Trusted Launch feature for configuring a dedicated secure vault - for keys and measurements held locally on the node. For more details, see - aka.ms/aks/trustedlaunch. If not specified, the default is false. - :vartype enable_vtpm: bool - :ivar enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only - signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. - If not specified, the default is false. - :vartype enable_secure_boot: bool - :ivar enable_encryption_at_host: Whether to enable host based OS and data drive encryption. - 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 - """ - - _attribute_map = { - "ssh_access": {"key": "sshAccess", "type": "str"}, - "enable_vtpm": {"key": "enableVTPM", "type": "bool"}, - "enable_secure_boot": {"key": "enableSecureBoot", "type": "bool"}, - "enable_encryption_at_host": {"key": "enableEncryptionAtHost", "type": "bool"}, - } - - def __init__( - self, - *, - ssh_access: Optional[Union[str, "_models.AgentPoolSSHAccess"]] = None, - enable_vtpm: Optional[bool] = None, - enable_secure_boot: Optional[bool] = None, - enable_encryption_at_host: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword ssh_access: SSH access method of an agent pool. Known values are: "LocalUser", - "Disabled", and "EntraId". - :paramtype ssh_access: str or ~azure.mgmt.containerservice.models.AgentPoolSSHAccess - :keyword enable_vtpm: vTPM is a Trusted Launch feature for configuring a dedicated secure vault - for keys and measurements held locally on the node. For more details, see - aka.ms/aks/trustedlaunch. If not specified, the default is false. - :paramtype enable_vtpm: bool - :keyword enable_secure_boot: Secure Boot is a feature of Trusted Launch which ensures that only - signed operating systems and drivers can boot. For more details, see aka.ms/aks/trustedlaunch. - If not specified, the default is false. - :paramtype enable_secure_boot: bool - :keyword enable_encryption_at_host: Whether to enable host based OS and data drive encryption. - 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 - """ - super().__init__(**kwargs) - self.ssh_access = ssh_access - self.enable_vtpm = enable_vtpm - self.enable_secure_boot = enable_secure_boot - self.enable_encryption_at_host = enable_encryption_at_host - - -class MachineStatus(_serialization.Model): - """Contains read-only information about the machine. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_error: The error details information of the machine. Preserves the detailed - info of failure. If there was no error, this field is omitted. - :vartype provisioning_error: ~azure.mgmt.containerservice.models.ErrorDetail - :ivar creation_timestamp: Specifies the time at which the machine was created. - :vartype creation_timestamp: ~datetime.datetime - :ivar drift_action: The drift action of the machine. Indicates whether a machine has deviated - from its expected state due to changes in managed cluster properties, requiring corrective - action. Known values are: "Synced" and "Recreate". - :vartype drift_action: str or ~azure.mgmt.containerservice.models.DriftAction - :ivar drift_reason: Reason for machine drift. Provides detailed information on why the machine - has drifted. This field is omitted if the machine is up to date. - :vartype drift_reason: str - :ivar vm_state: Virtual machine state. Indicates the current state of the underlying virtual - machine. Known values are: "Running" and "Deleted". - :vartype vm_state: str or ~azure.mgmt.containerservice.models.VmState - """ - - _validation = { - "provisioning_error": {"readonly": True}, - "creation_timestamp": {"readonly": True}, - "drift_action": {"readonly": True}, - "drift_reason": {"readonly": True}, - "vm_state": {"readonly": True}, - } - - _attribute_map = { - "provisioning_error": {"key": "provisioningError", "type": "ErrorDetail"}, - "creation_timestamp": {"key": "creationTimestamp", "type": "iso-8601"}, - "drift_action": {"key": "driftAction", "type": "str"}, - "drift_reason": {"key": "driftReason", "type": "str"}, - "vm_state": {"key": "vmState", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provisioning_error: Optional["_models.ErrorDetail"] = None - self.creation_timestamp: Optional[datetime.datetime] = None - self.drift_action: Optional[Union[str, "_models.DriftAction"]] = None - self.drift_reason: Optional[str] = None - self.vm_state: Optional[Union[str, "_models.VmState"]] = None - - -class MaintenanceConfiguration(SubResource): - """Planned maintenance configuration, used to configure when updates can be deployed to a Managed - Cluster. 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.models.SystemData - :ivar time_in_week: Time slots during the week when planned maintenance is allowed to proceed. - 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.models.TimeInWeek] - :ivar not_allowed_time: Time slots on which upgrade is not allowed. - :vartype not_allowed_time: list[~azure.mgmt.containerservice.models.TimeSpan] - :ivar maintenance_window: Maintenance window for the maintenance configuration. - :vartype maintenance_window: ~azure.mgmt.containerservice.models.MaintenanceWindow - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "time_in_week": {"key": "properties.timeInWeek", "type": "[TimeInWeek]"}, - "not_allowed_time": {"key": "properties.notAllowedTime", "type": "[TimeSpan]"}, - "maintenance_window": {"key": "properties.maintenanceWindow", "type": "MaintenanceWindow"}, - } - - def __init__( - self, - *, - time_in_week: Optional[list["_models.TimeInWeek"]] = None, - not_allowed_time: Optional[list["_models.TimeSpan"]] = None, - maintenance_window: Optional["_models.MaintenanceWindow"] = None, - **kwargs: Any - ) -> None: - """ - :keyword time_in_week: Time slots during the week when planned maintenance is allowed to - proceed. 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.models.TimeInWeek] - :keyword not_allowed_time: Time slots on which upgrade is not allowed. - :paramtype not_allowed_time: list[~azure.mgmt.containerservice.models.TimeSpan] - :keyword maintenance_window: Maintenance window for the maintenance configuration. - :paramtype maintenance_window: ~azure.mgmt.containerservice.models.MaintenanceWindow - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.time_in_week = time_in_week - self.not_allowed_time = not_allowed_time - self.maintenance_window = maintenance_window - - -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.models.MaintenanceConfiguration] - :ivar next_link: The URL to get the next set of maintenance configuration results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[MaintenanceConfiguration]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.MaintenanceConfiguration"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of maintenance configurations. - :paramtype value: list[~azure.mgmt.containerservice.models.MaintenanceConfiguration] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class MaintenanceWindow(_serialization.Model): - """Maintenance window used to configure scheduled auto-upgrade for a Managed Cluster. - - All required parameters must be populated in order to send to server. - - :ivar schedule: Recurrence schedule for the maintenance window. Required. - :vartype schedule: ~azure.mgmt.containerservice.models.Schedule - :ivar duration_hours: Length of maintenance window range from 4 to 24 hours. - :vartype duration_hours: int - :ivar utc_offset: The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and '-07:00' - for PST. If not specified, the default is '+00:00'. - :vartype utc_offset: str - :ivar start_date: The date the maintenance window activates. If the current date is before this - date, the maintenance window is inactive and will not be used for upgrades. If not specified, - the maintenance window will be active right away. - :vartype start_date: ~datetime.date - :ivar start_time: The start time of the maintenance window. Accepted values are from '00:00' to - '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' means - UTC time '00:00'. Required. - :vartype start_time: str - :ivar not_allowed_dates: Date ranges on which upgrade is not allowed. 'utcOffset' applies to - this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to - '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC - time. - :vartype not_allowed_dates: list[~azure.mgmt.containerservice.models.DateSpan] - """ - - _validation = { - "schedule": {"required": True}, - "duration_hours": {"required": True, "maximum": 24, "minimum": 4}, - "utc_offset": {"pattern": r"^(-|\+)[0-9]{2}:[0-9]{2}$"}, - "start_time": {"required": True, "pattern": r"^\d{2}:\d{2}$"}, - } - - _attribute_map = { - "schedule": {"key": "schedule", "type": "Schedule"}, - "duration_hours": {"key": "durationHours", "type": "int"}, - "utc_offset": {"key": "utcOffset", "type": "str"}, - "start_date": {"key": "startDate", "type": "date"}, - "start_time": {"key": "startTime", "type": "str"}, - "not_allowed_dates": {"key": "notAllowedDates", "type": "[DateSpan]"}, - } - - def __init__( - self, - *, - schedule: "_models.Schedule", - duration_hours: int = 24, - start_time: str, - utc_offset: Optional[str] = None, - start_date: Optional[datetime.date] = None, - not_allowed_dates: Optional[list["_models.DateSpan"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule: Recurrence schedule for the maintenance window. Required. - :paramtype schedule: ~azure.mgmt.containerservice.models.Schedule - :keyword duration_hours: Length of maintenance window range from 4 to 24 hours. - :paramtype duration_hours: int - :keyword utc_offset: The UTC offset in format +/-HH:mm. For example, '+05:30' for IST and - '-07:00' for PST. If not specified, the default is '+00:00'. - :paramtype utc_offset: str - :keyword start_date: The date the maintenance window activates. If the current date is before - this date, the maintenance window is inactive and will not be used for upgrades. If not - specified, the maintenance window will be active right away. - :paramtype start_date: ~datetime.date - :keyword start_time: The start time of the maintenance window. Accepted values are from '00:00' - to '23:59'. 'utcOffset' applies to this field. For example: '02:00' with 'utcOffset: +02:00' - means UTC time '00:00'. Required. - :paramtype start_time: str - :keyword not_allowed_dates: Date ranges on which upgrade is not allowed. 'utcOffset' applies to - this field. For example, with 'utcOffset: +02:00' and 'dateSpan' being '2022-12-23' to - '2023-01-03', maintenance will be blocked from '2022-12-22 22:00' to '2023-01-03 22:00' in UTC - time. - :paramtype not_allowed_dates: list[~azure.mgmt.containerservice.models.DateSpan] - """ - super().__init__(**kwargs) - self.schedule = schedule - self.duration_hours = duration_hours - self.utc_offset = utc_offset - self.start_date = start_date - self.start_time = start_time - self.not_allowed_dates = not_allowed_dates - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__(self, *, location: str, tags: Optional[dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - """ - super().__init__(**kwargs) - self.tags = tags - self.location = location - - -class ManagedCluster(TrackedResource): - """Managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value - will change when the resource is updated. Specify an if-match or if-none-match header with the - eTag value for a subsequent request to enable optimistic concurrency per the normal eTag - convention. - :vartype e_tag: str - :ivar sku: The managed cluster SKU. - :vartype sku: ~azure.mgmt.containerservice.models.ManagedClusterSKU - :ivar extended_location: The extended location of the Virtual Machine. - :vartype extended_location: ~azure.mgmt.containerservice.models.ExtendedLocation - :ivar identity: The identity of the managed cluster, if configured. - :vartype identity: ~azure.mgmt.containerservice.models.ManagedClusterIdentity - :ivar kind: This is primarily used to expose different UI experiences in the portal for - different kinds. - :vartype kind: str - :ivar provisioning_state: The current provisioning state. - :vartype provisioning_state: str - :ivar power_state: The Power State of the cluster. - :vartype power_state: ~azure.mgmt.containerservice.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.models.CreationData - :ivar max_agent_pools: The max number of agent pools for the managed cluster. - :vartype max_agent_pools: int - :ivar kubernetes_version: The version of Kubernetes the Managed Cluster is requested to run. - 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: The DNS prefix of the Managed Cluster. This cannot be updated once the - Managed Cluster has been created. - :vartype dns_prefix: str - :ivar fqdn_subdomain: The FQDN subdomain of the private cluster with custom private dns zone. - 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 special FQDN used by the Azure Portal to access the Managed - Cluster. This FQDN is for use only by the Azure Portal and should not be used by other clients. - 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.models.ManagedClusterAgentPoolProfile] - :ivar linux_profile: The profile for Linux VMs in the Managed Cluster. - :vartype linux_profile: ~azure.mgmt.containerservice.models.ContainerServiceLinuxProfile - :ivar windows_profile: The profile for Windows VMs in the Managed Cluster. - :vartype windows_profile: ~azure.mgmt.containerservice.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.models.ManagedClusterServicePrincipalProfile - :ivar addon_profiles: The profile of managed cluster add-on. - :vartype addon_profiles: dict[str, - ~azure.mgmt.containerservice.models.ManagedClusterAddonProfile] - :ivar pod_identity_profile: The pod identity profile of the Managed Cluster. See `use AAD pod - identity `_ for more details on - AAD pod identity integration. - :vartype pod_identity_profile: - ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProfile - :ivar oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. - :vartype oidc_issuer_profile: - ~azure.mgmt.containerservice.models.ManagedClusterOIDCIssuerProfile - :ivar node_resource_group: The name of the resource group containing agent pool nodes. - :vartype node_resource_group: str - :ivar node_resource_group_profile: The node resource group configuration profile. - :vartype node_resource_group_profile: - ~azure.mgmt.containerservice.models.ManagedClusterNodeResourceGroupProfile - :ivar enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :vartype enable_rbac: bool - :ivar support_plan: The support plan for the Managed Cluster. If unspecified, the default is - 'KubernetesOfficial'. Known values are: "KubernetesOfficial" and "AKSLongTermSupport". - :vartype support_plan: str or ~azure.mgmt.containerservice.models.KubernetesSupportPlan - :ivar enable_namespace_resources: Enable namespace as Azure resource. The default value is - false. It can be enabled/disabled on creation and updating of the managed cluster. See - `https://aka.ms/NamespaceARMResource `_ for more details - on Namespace as a ARM Resource. - :vartype enable_namespace_resources: bool - :ivar network_profile: The network configuration profile. - :vartype network_profile: ~azure.mgmt.containerservice.models.ContainerServiceNetworkProfile - :ivar aad_profile: The Azure Active Directory configuration. - :vartype aad_profile: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile - :ivar auto_upgrade_profile: The auto upgrade configuration. - :vartype auto_upgrade_profile: - ~azure.mgmt.containerservice.models.ManagedClusterAutoUpgradeProfile - :ivar upgrade_settings: Settings for upgrading a cluster. - :vartype upgrade_settings: ~azure.mgmt.containerservice.models.ClusterUpgradeSettings - :ivar auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :vartype auto_scaler_profile: - ~azure.mgmt.containerservice.models.ManagedClusterPropertiesAutoScalerProfile - :ivar api_server_access_profile: The access profile for managed cluster API server. - :vartype api_server_access_profile: - ~azure.mgmt.containerservice.models.ManagedClusterAPIServerAccessProfile - :ivar disk_encryption_set_id: The Resource ID of the disk encryption set to use for enabling - encryption at rest. This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :vartype disk_encryption_set_id: str - :ivar identity_profile: The user identity associated with the managed cluster. This identity - will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key - is "kubeletidentity", with value of "resourceId": - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". - :vartype identity_profile: dict[str, ~azure.mgmt.containerservice.models.UserAssignedIdentity] - :ivar private_link_resources: Private link resources associated with the cluster. - :vartype private_link_resources: list[~azure.mgmt.containerservice.models.PrivateLinkResource] - :ivar disable_local_accounts: If local accounts should be disabled on the Managed Cluster. 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.models.ManagedClusterHTTPProxyConfig - :ivar security_profile: Security profile for the managed cluster. - :vartype security_profile: ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfile - :ivar storage_profile: Storage profile for the managed cluster. - :vartype storage_profile: ~azure.mgmt.containerservice.models.ManagedClusterStorageProfile - :ivar ingress_profile: Ingress profile for the managed cluster. - :vartype ingress_profile: ~azure.mgmt.containerservice.models.ManagedClusterIngressProfile - :ivar public_network_access: PublicNetworkAccess of the managedCluster. Allow or deny public - network access for AKS. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". - :vartype public_network_access: str or ~azure.mgmt.containerservice.models.PublicNetworkAccess - :ivar workload_auto_scaler_profile: Workload Auto-scaler profile for the managed cluster. - :vartype workload_auto_scaler_profile: - ~azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfile - :ivar azure_monitor_profile: Prometheus addon profile for the container service cluster. - :vartype azure_monitor_profile: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfile - :ivar service_mesh_profile: Service mesh profile for a managed cluster. - :vartype service_mesh_profile: ~azure.mgmt.containerservice.models.ServiceMeshProfile - :ivar resource_uid: The resourceUID uniquely identifies ManagedClusters that reuse ARM - ResourceIds (i.e: create, delete, create sequence). - :vartype resource_uid: str - :ivar metrics_profile: Optional cluster metrics configuration. - :vartype metrics_profile: ~azure.mgmt.containerservice.models.ManagedClusterMetricsProfile - :ivar ai_toolchain_operator_profile: AI toolchain operator settings that apply to the whole - cluster. - :vartype ai_toolchain_operator_profile: - ~azure.mgmt.containerservice.models.ManagedClusterAIToolchainOperatorProfile - :ivar node_provisioning_profile: Node provisioning settings that apply to the whole cluster. - :vartype node_provisioning_profile: - ~azure.mgmt.containerservice.models.ManagedClusterNodeProvisioningProfile - :ivar bootstrap_profile: Profile of the cluster bootstrap configuration. - :vartype bootstrap_profile: ~azure.mgmt.containerservice.models.ManagedClusterBootstrapProfile - :ivar scheduler_profile: Profile of the pod scheduler configuration. - :vartype scheduler_profile: ~azure.mgmt.containerservice.models.SchedulerProfile - :ivar hosted_system_profile: Settings for hosted system addons. For more information, see - https://aka.ms/aks/automatic/systemcomponents. - :vartype hosted_system_profile: - ~azure.mgmt.containerservice.models.ManagedClusterHostedSystemProfile - :ivar status: Contains read-only information about the Managed Cluster. - :vartype status: ~azure.mgmt.containerservice.models.ManagedClusterStatus - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "e_tag": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "power_state": {"readonly": True}, - "max_agent_pools": {"readonly": True}, - "current_kubernetes_version": {"readonly": True}, - "fqdn": {"readonly": True}, - "private_fqdn": {"readonly": True}, - "azure_portal_fqdn": {"readonly": True}, - "resource_uid": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "e_tag": {"key": "eTag", "type": "str"}, - "sku": {"key": "sku", "type": "ManagedClusterSKU"}, - "extended_location": {"key": "extendedLocation", "type": "ExtendedLocation"}, - "identity": {"key": "identity", "type": "ManagedClusterIdentity"}, - "kind": {"key": "kind", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "power_state": {"key": "properties.powerState", "type": "PowerState"}, - "creation_data": {"key": "properties.creationData", "type": "CreationData"}, - "max_agent_pools": {"key": "properties.maxAgentPools", "type": "int"}, - "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, - "current_kubernetes_version": {"key": "properties.currentKubernetesVersion", "type": "str"}, - "dns_prefix": {"key": "properties.dnsPrefix", "type": "str"}, - "fqdn_subdomain": {"key": "properties.fqdnSubdomain", "type": "str"}, - "fqdn": {"key": "properties.fqdn", "type": "str"}, - "private_fqdn": {"key": "properties.privateFQDN", "type": "str"}, - "azure_portal_fqdn": {"key": "properties.azurePortalFQDN", "type": "str"}, - "agent_pool_profiles": {"key": "properties.agentPoolProfiles", "type": "[ManagedClusterAgentPoolProfile]"}, - "linux_profile": {"key": "properties.linuxProfile", "type": "ContainerServiceLinuxProfile"}, - "windows_profile": {"key": "properties.windowsProfile", "type": "ManagedClusterWindowsProfile"}, - "service_principal_profile": { - "key": "properties.servicePrincipalProfile", - "type": "ManagedClusterServicePrincipalProfile", - }, - "addon_profiles": {"key": "properties.addonProfiles", "type": "{ManagedClusterAddonProfile}"}, - "pod_identity_profile": {"key": "properties.podIdentityProfile", "type": "ManagedClusterPodIdentityProfile"}, - "oidc_issuer_profile": {"key": "properties.oidcIssuerProfile", "type": "ManagedClusterOIDCIssuerProfile"}, - "node_resource_group": {"key": "properties.nodeResourceGroup", "type": "str"}, - "node_resource_group_profile": { - "key": "properties.nodeResourceGroupProfile", - "type": "ManagedClusterNodeResourceGroupProfile", - }, - "enable_rbac": {"key": "properties.enableRBAC", "type": "bool"}, - "support_plan": {"key": "properties.supportPlan", "type": "str"}, - "enable_namespace_resources": {"key": "properties.enableNamespaceResources", "type": "bool"}, - "network_profile": {"key": "properties.networkProfile", "type": "ContainerServiceNetworkProfile"}, - "aad_profile": {"key": "properties.aadProfile", "type": "ManagedClusterAADProfile"}, - "auto_upgrade_profile": {"key": "properties.autoUpgradeProfile", "type": "ManagedClusterAutoUpgradeProfile"}, - "upgrade_settings": {"key": "properties.upgradeSettings", "type": "ClusterUpgradeSettings"}, - "auto_scaler_profile": { - "key": "properties.autoScalerProfile", - "type": "ManagedClusterPropertiesAutoScalerProfile", - }, - "api_server_access_profile": { - "key": "properties.apiServerAccessProfile", - "type": "ManagedClusterAPIServerAccessProfile", - }, - "disk_encryption_set_id": {"key": "properties.diskEncryptionSetID", "type": "str"}, - "identity_profile": {"key": "properties.identityProfile", "type": "{UserAssignedIdentity}"}, - "private_link_resources": {"key": "properties.privateLinkResources", "type": "[PrivateLinkResource]"}, - "disable_local_accounts": {"key": "properties.disableLocalAccounts", "type": "bool"}, - "http_proxy_config": {"key": "properties.httpProxyConfig", "type": "ManagedClusterHTTPProxyConfig"}, - "security_profile": {"key": "properties.securityProfile", "type": "ManagedClusterSecurityProfile"}, - "storage_profile": {"key": "properties.storageProfile", "type": "ManagedClusterStorageProfile"}, - "ingress_profile": {"key": "properties.ingressProfile", "type": "ManagedClusterIngressProfile"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "workload_auto_scaler_profile": { - "key": "properties.workloadAutoScalerProfile", - "type": "ManagedClusterWorkloadAutoScalerProfile", - }, - "azure_monitor_profile": {"key": "properties.azureMonitorProfile", "type": "ManagedClusterAzureMonitorProfile"}, - "service_mesh_profile": {"key": "properties.serviceMeshProfile", "type": "ServiceMeshProfile"}, - "resource_uid": {"key": "properties.resourceUID", "type": "str"}, - "metrics_profile": {"key": "properties.metricsProfile", "type": "ManagedClusterMetricsProfile"}, - "ai_toolchain_operator_profile": { - "key": "properties.aiToolchainOperatorProfile", - "type": "ManagedClusterAIToolchainOperatorProfile", - }, - "node_provisioning_profile": { - "key": "properties.nodeProvisioningProfile", - "type": "ManagedClusterNodeProvisioningProfile", - }, - "bootstrap_profile": {"key": "properties.bootstrapProfile", "type": "ManagedClusterBootstrapProfile"}, - "scheduler_profile": {"key": "properties.schedulerProfile", "type": "SchedulerProfile"}, - "hosted_system_profile": {"key": "properties.hostedSystemProfile", "type": "ManagedClusterHostedSystemProfile"}, - "status": {"key": "properties.status", "type": "ManagedClusterStatus"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - sku: Optional["_models.ManagedClusterSKU"] = None, - extended_location: Optional["_models.ExtendedLocation"] = None, - identity: Optional["_models.ManagedClusterIdentity"] = None, - kind: Optional[str] = None, - creation_data: Optional["_models.CreationData"] = None, - kubernetes_version: Optional[str] = None, - dns_prefix: Optional[str] = None, - fqdn_subdomain: Optional[str] = None, - agent_pool_profiles: Optional[list["_models.ManagedClusterAgentPoolProfile"]] = None, - linux_profile: Optional["_models.ContainerServiceLinuxProfile"] = None, - windows_profile: Optional["_models.ManagedClusterWindowsProfile"] = None, - service_principal_profile: Optional["_models.ManagedClusterServicePrincipalProfile"] = None, - addon_profiles: Optional[dict[str, "_models.ManagedClusterAddonProfile"]] = None, - pod_identity_profile: Optional["_models.ManagedClusterPodIdentityProfile"] = None, - oidc_issuer_profile: Optional["_models.ManagedClusterOIDCIssuerProfile"] = None, - node_resource_group: Optional[str] = None, - node_resource_group_profile: Optional["_models.ManagedClusterNodeResourceGroupProfile"] = None, - enable_rbac: Optional[bool] = None, - support_plan: Optional[Union[str, "_models.KubernetesSupportPlan"]] = None, - enable_namespace_resources: Optional[bool] = None, - network_profile: Optional["_models.ContainerServiceNetworkProfile"] = None, - aad_profile: Optional["_models.ManagedClusterAADProfile"] = None, - auto_upgrade_profile: Optional["_models.ManagedClusterAutoUpgradeProfile"] = None, - upgrade_settings: Optional["_models.ClusterUpgradeSettings"] = None, - auto_scaler_profile: Optional["_models.ManagedClusterPropertiesAutoScalerProfile"] = None, - api_server_access_profile: Optional["_models.ManagedClusterAPIServerAccessProfile"] = None, - disk_encryption_set_id: Optional[str] = None, - identity_profile: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, - private_link_resources: Optional[list["_models.PrivateLinkResource"]] = None, - disable_local_accounts: Optional[bool] = None, - http_proxy_config: Optional["_models.ManagedClusterHTTPProxyConfig"] = None, - security_profile: Optional["_models.ManagedClusterSecurityProfile"] = None, - storage_profile: Optional["_models.ManagedClusterStorageProfile"] = None, - ingress_profile: Optional["_models.ManagedClusterIngressProfile"] = None, - public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None, - workload_auto_scaler_profile: Optional["_models.ManagedClusterWorkloadAutoScalerProfile"] = None, - azure_monitor_profile: Optional["_models.ManagedClusterAzureMonitorProfile"] = None, - service_mesh_profile: Optional["_models.ServiceMeshProfile"] = None, - metrics_profile: Optional["_models.ManagedClusterMetricsProfile"] = None, - ai_toolchain_operator_profile: Optional["_models.ManagedClusterAIToolchainOperatorProfile"] = None, - node_provisioning_profile: Optional["_models.ManagedClusterNodeProvisioningProfile"] = None, - bootstrap_profile: Optional["_models.ManagedClusterBootstrapProfile"] = None, - scheduler_profile: Optional["_models.SchedulerProfile"] = None, - hosted_system_profile: Optional["_models.ManagedClusterHostedSystemProfile"] = None, - status: Optional["_models.ManagedClusterStatus"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword sku: The managed cluster SKU. - :paramtype sku: ~azure.mgmt.containerservice.models.ManagedClusterSKU - :keyword extended_location: The extended location of the Virtual Machine. - :paramtype extended_location: ~azure.mgmt.containerservice.models.ExtendedLocation - :keyword identity: The identity of the managed cluster, if configured. - :paramtype identity: ~azure.mgmt.containerservice.models.ManagedClusterIdentity - :keyword kind: This is primarily used to expose different UI experiences in the portal for - different kinds. - :paramtype kind: str - :keyword creation_data: CreationData to be used to specify the source Snapshot ID if the - cluster will be created/upgraded using a snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.models.CreationData - :keyword kubernetes_version: The version of Kubernetes the Managed Cluster is requested to run. - 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: The DNS prefix of the Managed Cluster. This cannot be updated once the - Managed Cluster has been created. - :paramtype dns_prefix: str - :keyword fqdn_subdomain: The FQDN subdomain of the private cluster with custom private dns - zone. 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.models.ManagedClusterAgentPoolProfile] - :keyword linux_profile: The profile for Linux VMs in the Managed Cluster. - :paramtype linux_profile: ~azure.mgmt.containerservice.models.ContainerServiceLinuxProfile - :keyword windows_profile: The profile for Windows VMs in the Managed Cluster. - :paramtype windows_profile: ~azure.mgmt.containerservice.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.models.ManagedClusterServicePrincipalProfile - :keyword addon_profiles: The profile of managed cluster add-on. - :paramtype addon_profiles: dict[str, - ~azure.mgmt.containerservice.models.ManagedClusterAddonProfile] - :keyword pod_identity_profile: The pod identity profile of the Managed Cluster. See `use AAD - pod identity `_ for more - details on AAD pod identity integration. - :paramtype pod_identity_profile: - ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProfile - :keyword oidc_issuer_profile: The OIDC issuer profile of the Managed Cluster. - :paramtype oidc_issuer_profile: - ~azure.mgmt.containerservice.models.ManagedClusterOIDCIssuerProfile - :keyword node_resource_group: The name of the resource group containing agent pool nodes. - :paramtype node_resource_group: str - :keyword node_resource_group_profile: The node resource group configuration profile. - :paramtype node_resource_group_profile: - ~azure.mgmt.containerservice.models.ManagedClusterNodeResourceGroupProfile - :keyword enable_rbac: Whether to enable Kubernetes Role-Based Access Control. - :paramtype enable_rbac: bool - :keyword support_plan: The support plan for the Managed Cluster. If unspecified, the default is - 'KubernetesOfficial'. Known values are: "KubernetesOfficial" and "AKSLongTermSupport". - :paramtype support_plan: str or ~azure.mgmt.containerservice.models.KubernetesSupportPlan - :keyword enable_namespace_resources: Enable namespace as Azure resource. The default value is - false. It can be enabled/disabled on creation and updating of the managed cluster. See - `https://aka.ms/NamespaceARMResource `_ for more details - on Namespace as a ARM Resource. - :paramtype enable_namespace_resources: bool - :keyword network_profile: The network configuration profile. - :paramtype network_profile: ~azure.mgmt.containerservice.models.ContainerServiceNetworkProfile - :keyword aad_profile: The Azure Active Directory configuration. - :paramtype aad_profile: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile - :keyword auto_upgrade_profile: The auto upgrade configuration. - :paramtype auto_upgrade_profile: - ~azure.mgmt.containerservice.models.ManagedClusterAutoUpgradeProfile - :keyword upgrade_settings: Settings for upgrading a cluster. - :paramtype upgrade_settings: ~azure.mgmt.containerservice.models.ClusterUpgradeSettings - :keyword auto_scaler_profile: Parameters to be applied to the cluster-autoscaler when enabled. - :paramtype auto_scaler_profile: - ~azure.mgmt.containerservice.models.ManagedClusterPropertiesAutoScalerProfile - :keyword api_server_access_profile: The access profile for managed cluster API server. - :paramtype api_server_access_profile: - ~azure.mgmt.containerservice.models.ManagedClusterAPIServerAccessProfile - :keyword disk_encryption_set_id: The Resource ID of the disk encryption set to use for enabling - encryption at rest. This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'. - :paramtype disk_encryption_set_id: str - :keyword identity_profile: The user identity associated with the managed cluster. This identity - will be used by the kubelet. Only one user assigned identity is allowed. The only accepted key - is "kubeletidentity", with value of "resourceId": - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}". - :paramtype identity_profile: dict[str, - ~azure.mgmt.containerservice.models.UserAssignedIdentity] - :keyword private_link_resources: Private link resources associated with the cluster. - :paramtype private_link_resources: - list[~azure.mgmt.containerservice.models.PrivateLinkResource] - :keyword disable_local_accounts: If local accounts should be disabled on the Managed Cluster. - 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.models.ManagedClusterHTTPProxyConfig - :keyword security_profile: Security profile for the managed cluster. - :paramtype security_profile: ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfile - :keyword storage_profile: Storage profile for the managed cluster. - :paramtype storage_profile: ~azure.mgmt.containerservice.models.ManagedClusterStorageProfile - :keyword ingress_profile: Ingress profile for the managed cluster. - :paramtype ingress_profile: ~azure.mgmt.containerservice.models.ManagedClusterIngressProfile - :keyword public_network_access: PublicNetworkAccess of the managedCluster. Allow or deny public - network access for AKS. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". - :paramtype public_network_access: str or - ~azure.mgmt.containerservice.models.PublicNetworkAccess - :keyword workload_auto_scaler_profile: Workload Auto-scaler profile for the managed cluster. - :paramtype workload_auto_scaler_profile: - ~azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfile - :keyword azure_monitor_profile: Prometheus addon profile for the container service cluster. - :paramtype azure_monitor_profile: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfile - :keyword service_mesh_profile: Service mesh profile for a managed cluster. - :paramtype service_mesh_profile: ~azure.mgmt.containerservice.models.ServiceMeshProfile - :keyword metrics_profile: Optional cluster metrics configuration. - :paramtype metrics_profile: ~azure.mgmt.containerservice.models.ManagedClusterMetricsProfile - :keyword ai_toolchain_operator_profile: AI toolchain operator settings that apply to the whole - cluster. - :paramtype ai_toolchain_operator_profile: - ~azure.mgmt.containerservice.models.ManagedClusterAIToolchainOperatorProfile - :keyword node_provisioning_profile: Node provisioning settings that apply to the whole cluster. - :paramtype node_provisioning_profile: - ~azure.mgmt.containerservice.models.ManagedClusterNodeProvisioningProfile - :keyword bootstrap_profile: Profile of the cluster bootstrap configuration. - :paramtype bootstrap_profile: - ~azure.mgmt.containerservice.models.ManagedClusterBootstrapProfile - :keyword scheduler_profile: Profile of the pod scheduler configuration. - :paramtype scheduler_profile: ~azure.mgmt.containerservice.models.SchedulerProfile - :keyword hosted_system_profile: Settings for hosted system addons. For more information, see - https://aka.ms/aks/automatic/systemcomponents. - :paramtype hosted_system_profile: - ~azure.mgmt.containerservice.models.ManagedClusterHostedSystemProfile - :keyword status: Contains read-only information about the Managed Cluster. - :paramtype status: ~azure.mgmt.containerservice.models.ManagedClusterStatus - """ - super().__init__(tags=tags, location=location, **kwargs) - self.e_tag: Optional[str] = None - self.sku = sku - self.extended_location = extended_location - self.identity = identity - self.kind = kind - self.provisioning_state: Optional[str] = None - self.power_state: Optional["_models.PowerState"] = None - self.creation_data = creation_data - self.max_agent_pools: Optional[int] = None - self.kubernetes_version = kubernetes_version - self.current_kubernetes_version: Optional[str] = None - self.dns_prefix = dns_prefix - self.fqdn_subdomain = fqdn_subdomain - self.fqdn: Optional[str] = None - self.private_fqdn: Optional[str] = None - self.azure_portal_fqdn: Optional[str] = None - self.agent_pool_profiles = agent_pool_profiles - self.linux_profile = linux_profile - self.windows_profile = windows_profile - self.service_principal_profile = service_principal_profile - self.addon_profiles = addon_profiles - self.pod_identity_profile = pod_identity_profile - self.oidc_issuer_profile = oidc_issuer_profile - self.node_resource_group = node_resource_group - self.node_resource_group_profile = node_resource_group_profile - self.enable_rbac = enable_rbac - self.support_plan = support_plan - self.enable_namespace_resources = enable_namespace_resources - self.network_profile = network_profile - self.aad_profile = aad_profile - self.auto_upgrade_profile = auto_upgrade_profile - self.upgrade_settings = upgrade_settings - self.auto_scaler_profile = auto_scaler_profile - self.api_server_access_profile = api_server_access_profile - self.disk_encryption_set_id = disk_encryption_set_id - self.identity_profile = identity_profile - self.private_link_resources = private_link_resources - self.disable_local_accounts = disable_local_accounts - self.http_proxy_config = http_proxy_config - self.security_profile = security_profile - self.storage_profile = storage_profile - self.ingress_profile = ingress_profile - self.public_network_access = public_network_access - self.workload_auto_scaler_profile = workload_auto_scaler_profile - self.azure_monitor_profile = azure_monitor_profile - self.service_mesh_profile = service_mesh_profile - self.resource_uid: Optional[str] = None - self.metrics_profile = metrics_profile - self.ai_toolchain_operator_profile = ai_toolchain_operator_profile - self.node_provisioning_profile = node_provisioning_profile - self.bootstrap_profile = bootstrap_profile - self.scheduler_profile = scheduler_profile - self.hosted_system_profile = hosted_system_profile - self.status = status - - -class ManagedClusterAADProfile(_serialization.Model): - """AADProfile specifies attributes for Azure Active Directory integration. For more details see - `managed AAD on AKS `_. - - :ivar managed: Whether to enable managed AAD. - :vartype managed: bool - :ivar enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :vartype enable_azure_rbac: bool - :ivar admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of - the cluster. - :vartype admin_group_object_i_ds: list[str] - :ivar client_app_id: (DEPRECATED) The client AAD application ID. Learn more at - https://aka.ms/aks/aad-legacy. - :vartype client_app_id: str - :ivar server_app_id: (DEPRECATED) The server AAD application ID. Learn more at - https://aka.ms/aks/aad-legacy. - :vartype server_app_id: str - :ivar server_app_secret: (DEPRECATED) The server AAD application secret. Learn more at - https://aka.ms/aks/aad-legacy. - :vartype server_app_secret: str - :ivar tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :vartype tenant_id: str - """ - - _attribute_map = { - "managed": {"key": "managed", "type": "bool"}, - "enable_azure_rbac": {"key": "enableAzureRBAC", "type": "bool"}, - "admin_group_object_i_ds": {"key": "adminGroupObjectIDs", "type": "[str]"}, - "client_app_id": {"key": "clientAppID", "type": "str"}, - "server_app_id": {"key": "serverAppID", "type": "str"}, - "server_app_secret": {"key": "serverAppSecret", "type": "str"}, - "tenant_id": {"key": "tenantID", "type": "str"}, - } - - def __init__( - self, - *, - managed: Optional[bool] = None, - enable_azure_rbac: Optional[bool] = None, - admin_group_object_i_ds: Optional[list[str]] = None, - client_app_id: Optional[str] = None, - server_app_id: Optional[str] = None, - server_app_secret: Optional[str] = None, - tenant_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword managed: Whether to enable managed AAD. - :paramtype managed: bool - :keyword enable_azure_rbac: Whether to enable Azure RBAC for Kubernetes authorization. - :paramtype enable_azure_rbac: bool - :keyword admin_group_object_i_ds: The list of AAD group object IDs that will have admin role of - the cluster. - :paramtype admin_group_object_i_ds: list[str] - :keyword client_app_id: (DEPRECATED) The client AAD application ID. Learn more at - https://aka.ms/aks/aad-legacy. - :paramtype client_app_id: str - :keyword server_app_id: (DEPRECATED) The server AAD application ID. Learn more at - https://aka.ms/aks/aad-legacy. - :paramtype server_app_id: str - :keyword server_app_secret: (DEPRECATED) The server AAD application secret. Learn more at - https://aka.ms/aks/aad-legacy. - :paramtype server_app_secret: str - :keyword tenant_id: The AAD tenant ID to use for authentication. If not specified, will use the - tenant of the deployment subscription. - :paramtype tenant_id: str - """ - super().__init__(**kwargs) - self.managed = managed - self.enable_azure_rbac = enable_azure_rbac - self.admin_group_object_i_ds = admin_group_object_i_ds - self.client_app_id = client_app_id - self.server_app_id = server_app_id - self.server_app_secret = server_app_secret - self.tenant_id = tenant_id - - -class ManagedClusterAccessProfile(TrackedResource): - """Managed cluster Access Profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar kube_config: Base64-encoded Kubernetes configuration file. - :vartype kube_config: bytes - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "kube_config": {"key": "properties.kubeConfig", "type": "bytearray"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - kube_config: Optional[bytes] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword kube_config: Base64-encoded Kubernetes configuration file. - :paramtype kube_config: bytes - """ - super().__init__(tags=tags, location=location, **kwargs) - self.kube_config = kube_config - - -class ManagedClusterAddonProfile(_serialization.Model): - """A Kubernetes add-on profile for a managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar enabled: Whether the add-on is enabled or not. Required. - :vartype enabled: bool - :ivar config: Key-value pairs for configuring an add-on. - :vartype config: dict[str, str] - :ivar identity: Information of user assigned identity used by this add-on. - :vartype identity: ~azure.mgmt.containerservice.models.ManagedClusterAddonProfileIdentity - """ - - _validation = { - "enabled": {"required": True}, - "identity": {"readonly": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "config": {"key": "config", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedClusterAddonProfileIdentity"}, - } - - def __init__(self, *, enabled: bool, config: Optional[dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether the add-on is enabled or not. Required. - :paramtype enabled: bool - :keyword config: Key-value pairs for configuring an add-on. - :paramtype config: dict[str, str] - """ - super().__init__(**kwargs) - self.enabled = enabled - self.config = config - self.identity: Optional["_models.ManagedClusterAddonProfileIdentity"] = None - - -class UserAssignedIdentity(_serialization.Model): - """Details about a user assigned identity. - - :ivar resource_id: The resource ID of the user assigned identity. - :vartype resource_id: str - :ivar client_id: The client ID of the user assigned identity. - :vartype client_id: str - :ivar object_id: The object ID of the user assigned identity. - :vartype object_id: str - """ - - _attribute_map = { - "resource_id": {"key": "resourceId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - "object_id": {"key": "objectId", "type": "str"}, - } - - def __init__( - self, - *, - resource_id: Optional[str] = None, - client_id: Optional[str] = None, - object_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword resource_id: The resource ID of the user assigned identity. - :paramtype resource_id: str - :keyword client_id: The client ID of the user assigned identity. - :paramtype client_id: str - :keyword object_id: The object ID of the user assigned identity. - :paramtype object_id: str - """ - super().__init__(**kwargs) - self.resource_id = resource_id - self.client_id = client_id - self.object_id = object_id - - -class ManagedClusterAddonProfileIdentity(UserAssignedIdentity): - """Information of user assigned identity used by this add-on. - - :ivar resource_id: The resource ID of the user assigned identity. - :vartype resource_id: str - :ivar client_id: The client ID of the user assigned identity. - :vartype client_id: str - :ivar object_id: The object ID of the user assigned identity. - :vartype object_id: str - """ - - -class ManagedClusterAgentPoolProfileProperties(_serialization.Model): - """Properties for the container service agent pool profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value - will change when the resource is updated. Specify an if-match or if-none-match header with the - eTag value for a subsequent request to enable optimistic concurrency per the normal eTag - convention. - :vartype e_tag: str - :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :vartype count: int - :ivar vm_size: The size of the agent pool VMs. 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 OS disk type to be used for machines in the agent pool. 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.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.models.KubeletDiskType - :ivar workload_runtime: Determines the type of workload a node can run. Known values are: - "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". - :vartype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime - :ivar message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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: The ID of the subnet which agent pool nodes and optionally pods will join - on startup. 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: The ID of the subnet which pods will join when launched. 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 pod_ip_allocation_mode: Pod IP Allocation Mode. The IP allocation mode for pods in the - agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values - are: "DynamicIndividual" and "StaticBlock". - :vartype pod_ip_allocation_mode: str or ~azure.mgmt.containerservice.models.PodIPAllocationMode - :ivar max_pods: The maximum number of pods that can run on a node. - :vartype max_pods: int - :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and - "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType - :ivar os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is - Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be - changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", - "AzureLinux", "AzureLinux3", "Flatcar", "CBLMariner", "Windows2019", "Windows2022", - "Windows2025", "WindowsAnnual", "Ubuntu2204", and "Ubuntu2404". - :vartype os_sku: str or ~azure.mgmt.containerservice.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: The scale down mode to use when scaling the Agent Pool. 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.models.ScaleDownMode - :ivar type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", - "AvailabilitySet", and "VirtualMachines". - :vartype type: str or ~azure.mgmt.containerservice.models.AgentPoolType - :ivar mode: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at - all times. For additional information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", - "Gateway", "ManagedSystem", and "Machines". - :vartype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode - :ivar orchestrator_version: The version of Kubernetes specified by the user. 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: The version of Kubernetes running on the Agent Pool. 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_strategy: Defines the upgrade strategy for the agent pool. The default is - Rolling. Known values are: "Rolling" and "BlueGreen". - :vartype upgrade_strategy: str or ~azure.mgmt.containerservice.models.UpgradeStrategy - :ivar upgrade_settings: Settings for upgrading the agentpool. Applies when upgrade strategy is - set to Rolling. - :vartype upgrade_settings: ~azure.mgmt.containerservice.models.AgentPoolUpgradeSettings - :ivar upgrade_settings_blue_green: Settings for Blue-Green upgrade on the agentpool. Applies - when upgrade strategy is set to BlueGreen. - :vartype upgrade_settings_blue_green: - ~azure.mgmt.containerservice.models.AgentPoolBlueGreenUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Whether the Agent Pool is running or stopped. 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.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: Whether each node is allocated its own 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 node_public_ip_prefix_id: The public IP prefix ID which VM nodes should use IPs from. - 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.models.ScaleSetPriority - :ivar scale_set_eviction_policy: The Virtual Machine Scale Set eviction policy to use. 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.models.ScaleSetEvictionPolicy - :ivar spot_max_price: The max price (in US Dollars) you are willing to pay for spot instances. - Possible values are any decimal value greater than zero or -1 which indicates default price to - be up-to on-demand. Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :vartype spot_max_price: float - :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. - :vartype tags: dict[str, str] - :ivar node_labels: The node labels to be persisted across all nodes in agent pool. - :vartype node_labels: dict[str, str] - :ivar node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :vartype node_taints: list[str] - :ivar node_initialization_taints: Taints added on the nodes during creation that will not be - reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl - call. This field can be modified after node pool is created, but nodes will not be recreated - with new taints until another operation that requires recreation (e.g. node image upgrade) - happens. These taints allow for required configuration to run before the node is ready to - accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl - taint nodes node1 key1=value1:NoSchedule-``. - :vartype node_initialization_taints: list[str] - :ivar proximity_placement_group_id: The ID for Proximity Placement Group. - :vartype proximity_placement_group_id: str - :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. - :vartype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig - :ivar linux_os_config: The OS configuration of Linux agent nodes. - :vartype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig - :ivar enable_encryption_at_host: Whether to enable host based OS and data drive encryption. - 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: Whether to use a FIPS-enabled OS. 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.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.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: The fully qualified resource ID of the Dedicated Host Group to provision - virtual machines from, used only in creation scenario and not allowed to changed once set. 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.models.AgentPoolWindowsProfile - :ivar network_profile: Network-related settings of an agent pool. - :vartype network_profile: ~azure.mgmt.containerservice.models.AgentPoolNetworkProfile - :ivar security_profile: The security settings of an agent pool. - :vartype security_profile: ~azure.mgmt.containerservice.models.AgentPoolSecurityProfile - :ivar gpu_profile: The GPU settings of an agent pool. - :vartype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile - :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. - :vartype artifact_streaming_profile: - ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile - :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. - :vartype virtual_machines_profile: ~azure.mgmt.containerservice.models.VirtualMachinesProfile - :ivar virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. - :vartype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.models.VirtualMachineNodes] - :ivar gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field - cannot be set if agent pool mode is not Gateway. - :vartype gateway_profile: ~azure.mgmt.containerservice.models.AgentPoolGatewayProfile - :ivar status: Contains read-only information about the Agent Pool. - :vartype status: ~azure.mgmt.containerservice.models.AgentPoolStatus - :ivar local_dns_profile: Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. - LocalDNS helps improve performance and reliability of DNS resolution in an AKS cluster. For - more details see aka.ms/aks/localdns. - :vartype local_dns_profile: ~azure.mgmt.containerservice.models.LocalDNSProfile - :ivar node_customization_profile: Settings to determine the node customization used to - provision nodes in a pool. - :vartype node_customization_profile: - ~azure.mgmt.containerservice.models.NodeCustomizationProfile - """ - - _validation = { - "e_tag": {"readonly": True}, - "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, - "current_orchestrator_version": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "e_tag": {"key": "eTag", "type": "str"}, - "count": {"key": "count", "type": "int"}, - "vm_size": {"key": "vmSize", "type": "str"}, - "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, - "os_disk_type": {"key": "osDiskType", "type": "str"}, - "kubelet_disk_type": {"key": "kubeletDiskType", "type": "str"}, - "workload_runtime": {"key": "workloadRuntime", "type": "str"}, - "message_of_the_day": {"key": "messageOfTheDay", "type": "str"}, - "vnet_subnet_id": {"key": "vnetSubnetID", "type": "str"}, - "pod_subnet_id": {"key": "podSubnetID", "type": "str"}, - "pod_ip_allocation_mode": {"key": "podIPAllocationMode", "type": "str"}, - "max_pods": {"key": "maxPods", "type": "int"}, - "os_type": {"key": "osType", "type": "str"}, - "os_sku": {"key": "osSKU", "type": "str"}, - "max_count": {"key": "maxCount", "type": "int"}, - "min_count": {"key": "minCount", "type": "int"}, - "enable_auto_scaling": {"key": "enableAutoScaling", "type": "bool"}, - "scale_down_mode": {"key": "scaleDownMode", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "mode": {"key": "mode", "type": "str"}, - "orchestrator_version": {"key": "orchestratorVersion", "type": "str"}, - "current_orchestrator_version": {"key": "currentOrchestratorVersion", "type": "str"}, - "node_image_version": {"key": "nodeImageVersion", "type": "str"}, - "upgrade_strategy": {"key": "upgradeStrategy", "type": "str"}, - "upgrade_settings": {"key": "upgradeSettings", "type": "AgentPoolUpgradeSettings"}, - "upgrade_settings_blue_green": {"key": "upgradeSettingsBlueGreen", "type": "AgentPoolBlueGreenUpgradeSettings"}, - "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"}, - "node_public_ip_prefix_id": {"key": "nodePublicIPPrefixID", "type": "str"}, - "scale_set_priority": {"key": "scaleSetPriority", "type": "str"}, - "scale_set_eviction_policy": {"key": "scaleSetEvictionPolicy", "type": "str"}, - "spot_max_price": {"key": "spotMaxPrice", "type": "float"}, - "tags": {"key": "tags", "type": "{str}"}, - "node_labels": {"key": "nodeLabels", "type": "{str}"}, - "node_taints": {"key": "nodeTaints", "type": "[str]"}, - "node_initialization_taints": {"key": "nodeInitializationTaints", "type": "[str]"}, - "proximity_placement_group_id": {"key": "proximityPlacementGroupID", "type": "str"}, - "kubelet_config": {"key": "kubeletConfig", "type": "KubeletConfig"}, - "linux_os_config": {"key": "linuxOSConfig", "type": "LinuxOSConfig"}, - "enable_encryption_at_host": {"key": "enableEncryptionAtHost", "type": "bool"}, - "enable_ultra_ssd": {"key": "enableUltraSSD", "type": "bool"}, - "enable_fips": {"key": "enableFIPS", "type": "bool"}, - "gpu_instance_profile": {"key": "gpuInstanceProfile", "type": "str"}, - "creation_data": {"key": "creationData", "type": "CreationData"}, - "capacity_reservation_group_id": {"key": "capacityReservationGroupID", "type": "str"}, - "host_group_id": {"key": "hostGroupID", "type": "str"}, - "windows_profile": {"key": "windowsProfile", "type": "AgentPoolWindowsProfile"}, - "network_profile": {"key": "networkProfile", "type": "AgentPoolNetworkProfile"}, - "security_profile": {"key": "securityProfile", "type": "AgentPoolSecurityProfile"}, - "gpu_profile": {"key": "gpuProfile", "type": "GPUProfile"}, - "artifact_streaming_profile": {"key": "artifactStreamingProfile", "type": "AgentPoolArtifactStreamingProfile"}, - "virtual_machines_profile": {"key": "virtualMachinesProfile", "type": "VirtualMachinesProfile"}, - "virtual_machine_nodes_status": {"key": "virtualMachineNodesStatus", "type": "[VirtualMachineNodes]"}, - "gateway_profile": {"key": "gatewayProfile", "type": "AgentPoolGatewayProfile"}, - "status": {"key": "status", "type": "AgentPoolStatus"}, - "local_dns_profile": {"key": "localDNSProfile", "type": "LocalDNSProfile"}, - "node_customization_profile": {"key": "nodeCustomizationProfile", "type": "NodeCustomizationProfile"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - count: Optional[int] = None, - vm_size: Optional[str] = None, - os_disk_size_gb: Optional[int] = None, - os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, - kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, - workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, - message_of_the_day: Optional[str] = None, - vnet_subnet_id: Optional[str] = None, - pod_subnet_id: Optional[str] = None, - pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, - max_pods: Optional[int] = None, - os_type: Union[str, "_models.OSType"] = "Linux", - os_sku: Optional[Union[str, "_models.OSSKU"]] = None, - max_count: Optional[int] = None, - min_count: Optional[int] = None, - enable_auto_scaling: Optional[bool] = None, - scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, - type: Optional[Union[str, "_models.AgentPoolType"]] = None, - mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, - orchestrator_version: Optional[str] = None, - node_image_version: Optional[str] = None, - upgrade_strategy: Optional[Union[str, "_models.UpgradeStrategy"]] = None, - upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, - upgrade_settings_blue_green: Optional["_models.AgentPoolBlueGreenUpgradeSettings"] = None, - power_state: Optional["_models.PowerState"] = None, - availability_zones: Optional[list[str]] = None, - enable_node_public_ip: Optional[bool] = None, - node_public_ip_prefix_id: Optional[str] = None, - scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", - scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", - spot_max_price: float = -1, - tags: Optional[dict[str, str]] = None, - node_labels: Optional[dict[str, str]] = None, - node_taints: Optional[list[str]] = None, - node_initialization_taints: Optional[list[str]] = None, - proximity_placement_group_id: Optional[str] = None, - kubelet_config: Optional["_models.KubeletConfig"] = None, - linux_os_config: Optional["_models.LinuxOSConfig"] = None, - enable_encryption_at_host: Optional[bool] = None, - enable_ultra_ssd: Optional[bool] = None, - enable_fips: Optional[bool] = None, - gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, - creation_data: Optional["_models.CreationData"] = None, - capacity_reservation_group_id: Optional[str] = None, - host_group_id: Optional[str] = None, - windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, - network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, - security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, - gpu_profile: Optional["_models.GPUProfile"] = None, - artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, - virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, - virtual_machine_nodes_status: Optional[list["_models.VirtualMachineNodes"]] = None, - gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, - status: Optional["_models.AgentPoolStatus"] = None, - local_dns_profile: Optional["_models.LocalDNSProfile"] = None, - node_customization_profile: Optional["_models.NodeCustomizationProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :paramtype count: int - :keyword vm_size: The size of the agent pool VMs. 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 OS disk type to be used for machines in the agent pool. 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.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.models.KubeletDiskType - :keyword workload_runtime: Determines the type of workload a node can run. Known values are: - "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". - :paramtype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime - :keyword message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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: The ID of the subnet which agent pool nodes and optionally pods will - join on startup. 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: The ID of the subnet which pods will join when launched. 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 pod_ip_allocation_mode: Pod IP Allocation Mode. The IP allocation mode for pods in the - agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values - are: "DynamicIndividual" and "StaticBlock". - :paramtype pod_ip_allocation_mode: str or - ~azure.mgmt.containerservice.models.PodIPAllocationMode - :keyword max_pods: The maximum number of pods that can run on a node. - :paramtype max_pods: int - :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" - and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.models.OSType - :keyword os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is - Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be - changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", - "AzureLinux", "AzureLinux3", "Flatcar", "CBLMariner", "Windows2019", "Windows2022", - "Windows2025", "WindowsAnnual", "Ubuntu2204", and "Ubuntu2404". - :paramtype os_sku: str or ~azure.mgmt.containerservice.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: The scale down mode to use when scaling the Agent Pool. 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.models.ScaleDownMode - :keyword type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", - "AvailabilitySet", and "VirtualMachines". - :paramtype type: str or ~azure.mgmt.containerservice.models.AgentPoolType - :keyword mode: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool - at all times. For additional information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", - "Gateway", "ManagedSystem", and "Machines". - :paramtype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode - :keyword orchestrator_version: The version of Kubernetes specified by the user. 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 node_image_version: The version of node image. - :paramtype node_image_version: str - :keyword upgrade_strategy: Defines the upgrade strategy for the agent pool. The default is - Rolling. Known values are: "Rolling" and "BlueGreen". - :paramtype upgrade_strategy: str or ~azure.mgmt.containerservice.models.UpgradeStrategy - :keyword upgrade_settings: Settings for upgrading the agentpool. Applies when upgrade strategy - is set to Rolling. - :paramtype upgrade_settings: ~azure.mgmt.containerservice.models.AgentPoolUpgradeSettings - :keyword upgrade_settings_blue_green: Settings for Blue-Green upgrade on the agentpool. Applies - when upgrade strategy is set to BlueGreen. - :paramtype upgrade_settings_blue_green: - ~azure.mgmt.containerservice.models.AgentPoolBlueGreenUpgradeSettings - :keyword power_state: Whether the Agent Pool is running or stopped. 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.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: Whether each node is allocated its own 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 node_public_ip_prefix_id: The public IP prefix ID which VM nodes should use IPs from. - 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.models.ScaleSetPriority - :keyword scale_set_eviction_policy: The Virtual Machine Scale Set eviction policy to use. 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.models.ScaleSetEvictionPolicy - :keyword spot_max_price: The max price (in US Dollars) you are willing to pay for spot - instances. Possible values are any decimal value greater than zero or -1 which indicates - default price to be up-to on-demand. Possible values are any decimal value greater than zero or - -1 which indicates the willingness to pay any on-demand price. For more details on spot - pricing, see `spot VMs pricing - `_. - :paramtype spot_max_price: float - :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. - :paramtype tags: dict[str, str] - :keyword node_labels: The node labels to be persisted across all nodes in agent pool. - :paramtype node_labels: dict[str, str] - :keyword node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :paramtype node_taints: list[str] - :keyword node_initialization_taints: Taints added on the nodes during creation that will not be - reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl - call. This field can be modified after node pool is created, but nodes will not be recreated - with new taints until another operation that requires recreation (e.g. node image upgrade) - happens. These taints allow for required configuration to run before the node is ready to - accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl - taint nodes node1 key1=value1:NoSchedule-``. - :paramtype node_initialization_taints: list[str] - :keyword proximity_placement_group_id: The ID for Proximity Placement Group. - :paramtype proximity_placement_group_id: str - :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. - :paramtype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig - :keyword linux_os_config: The OS configuration of Linux agent nodes. - :paramtype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig - :keyword enable_encryption_at_host: Whether to enable host based OS and data drive encryption. - 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: Whether to use a FIPS-enabled OS. 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.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.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: The fully qualified resource ID of the Dedicated Host Group to - provision virtual machines from, used only in creation scenario and not allowed to changed once - set. 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.models.AgentPoolWindowsProfile - :keyword network_profile: Network-related settings of an agent pool. - :paramtype network_profile: ~azure.mgmt.containerservice.models.AgentPoolNetworkProfile - :keyword security_profile: The security settings of an agent pool. - :paramtype security_profile: ~azure.mgmt.containerservice.models.AgentPoolSecurityProfile - :keyword gpu_profile: The GPU settings of an agent pool. - :paramtype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile - :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. - :paramtype artifact_streaming_profile: - ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile - :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. - :paramtype virtual_machines_profile: ~azure.mgmt.containerservice.models.VirtualMachinesProfile - :keyword virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. - :paramtype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.models.VirtualMachineNodes] - :keyword gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field - cannot be set if agent pool mode is not Gateway. - :paramtype gateway_profile: ~azure.mgmt.containerservice.models.AgentPoolGatewayProfile - :keyword status: Contains read-only information about the Agent Pool. - :paramtype status: ~azure.mgmt.containerservice.models.AgentPoolStatus - :keyword local_dns_profile: Configures the per-node local DNS, with VnetDNS and KubeDNS - overrides. LocalDNS helps improve performance and reliability of DNS resolution in an AKS - cluster. For more details see aka.ms/aks/localdns. - :paramtype local_dns_profile: ~azure.mgmt.containerservice.models.LocalDNSProfile - :keyword node_customization_profile: Settings to determine the node customization used to - provision nodes in a pool. - :paramtype node_customization_profile: - ~azure.mgmt.containerservice.models.NodeCustomizationProfile - """ - super().__init__(**kwargs) - self.e_tag: Optional[str] = None - self.count = count - self.vm_size = vm_size - self.os_disk_size_gb = os_disk_size_gb - self.os_disk_type = os_disk_type - self.kubelet_disk_type = kubelet_disk_type - self.workload_runtime = workload_runtime - self.message_of_the_day = message_of_the_day - self.vnet_subnet_id = vnet_subnet_id - self.pod_subnet_id = pod_subnet_id - self.pod_ip_allocation_mode = pod_ip_allocation_mode - self.max_pods = max_pods - self.os_type = os_type - self.os_sku = os_sku - self.max_count = max_count - self.min_count = min_count - self.enable_auto_scaling = enable_auto_scaling - self.scale_down_mode = scale_down_mode - self.type = type - self.mode = mode - self.orchestrator_version = orchestrator_version - self.current_orchestrator_version: Optional[str] = None - self.node_image_version = node_image_version - self.upgrade_strategy = upgrade_strategy - self.upgrade_settings = upgrade_settings - self.upgrade_settings_blue_green = upgrade_settings_blue_green - self.provisioning_state: Optional[str] = None - self.power_state = power_state - self.availability_zones = availability_zones - self.enable_node_public_ip = enable_node_public_ip - self.node_public_ip_prefix_id = node_public_ip_prefix_id - self.scale_set_priority = scale_set_priority - self.scale_set_eviction_policy = scale_set_eviction_policy - self.spot_max_price = spot_max_price - self.tags = tags - self.node_labels = node_labels - self.node_taints = node_taints - self.node_initialization_taints = node_initialization_taints - self.proximity_placement_group_id = proximity_placement_group_id - self.kubelet_config = kubelet_config - self.linux_os_config = linux_os_config - self.enable_encryption_at_host = enable_encryption_at_host - self.enable_ultra_ssd = enable_ultra_ssd - self.enable_fips = enable_fips - self.gpu_instance_profile = gpu_instance_profile - self.creation_data = creation_data - self.capacity_reservation_group_id = capacity_reservation_group_id - self.host_group_id = host_group_id - self.windows_profile = windows_profile - self.network_profile = network_profile - self.security_profile = security_profile - self.gpu_profile = gpu_profile - self.artifact_streaming_profile = artifact_streaming_profile - self.virtual_machines_profile = virtual_machines_profile - self.virtual_machine_nodes_status = virtual_machine_nodes_status - self.gateway_profile = gateway_profile - self.status = status - self.local_dns_profile = local_dns_profile - self.node_customization_profile = node_customization_profile - - -class ManagedClusterAgentPoolProfile(ManagedClusterAgentPoolProfileProperties): - """Profile for the container service agent pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value - will change when the resource is updated. Specify an if-match or if-none-match header with the - eTag value for a subsequent request to enable optimistic concurrency per the normal eTag - convention. - :vartype e_tag: str - :ivar count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :vartype count: int - :ivar vm_size: The size of the agent pool VMs. 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 OS disk type to be used for machines in the agent pool. 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.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.models.KubeletDiskType - :ivar workload_runtime: Determines the type of workload a node can run. Known values are: - "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". - :vartype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime - :ivar message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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: The ID of the subnet which agent pool nodes and optionally pods will join - on startup. 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: The ID of the subnet which pods will join when launched. 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 pod_ip_allocation_mode: Pod IP Allocation Mode. The IP allocation mode for pods in the - agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values - are: "DynamicIndividual" and "StaticBlock". - :vartype pod_ip_allocation_mode: str or ~azure.mgmt.containerservice.models.PodIPAllocationMode - :ivar max_pods: The maximum number of pods that can run on a node. - :vartype max_pods: int - :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and - "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType - :ivar os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is - Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be - changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", - "AzureLinux", "AzureLinux3", "Flatcar", "CBLMariner", "Windows2019", "Windows2022", - "Windows2025", "WindowsAnnual", "Ubuntu2204", and "Ubuntu2404". - :vartype os_sku: str or ~azure.mgmt.containerservice.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: The scale down mode to use when scaling the Agent Pool. 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.models.ScaleDownMode - :ivar type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", - "AvailabilitySet", and "VirtualMachines". - :vartype type: str or ~azure.mgmt.containerservice.models.AgentPoolType - :ivar mode: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool at - all times. For additional information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", - "Gateway", "ManagedSystem", and "Machines". - :vartype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode - :ivar orchestrator_version: The version of Kubernetes specified by the user. 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: The version of Kubernetes running on the Agent Pool. 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_strategy: Defines the upgrade strategy for the agent pool. The default is - Rolling. Known values are: "Rolling" and "BlueGreen". - :vartype upgrade_strategy: str or ~azure.mgmt.containerservice.models.UpgradeStrategy - :ivar upgrade_settings: Settings for upgrading the agentpool. Applies when upgrade strategy is - set to Rolling. - :vartype upgrade_settings: ~azure.mgmt.containerservice.models.AgentPoolUpgradeSettings - :ivar upgrade_settings_blue_green: Settings for Blue-Green upgrade on the agentpool. Applies - when upgrade strategy is set to BlueGreen. - :vartype upgrade_settings_blue_green: - ~azure.mgmt.containerservice.models.AgentPoolBlueGreenUpgradeSettings - :ivar provisioning_state: The current deployment or provisioning state. - :vartype provisioning_state: str - :ivar power_state: Whether the Agent Pool is running or stopped. 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.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: Whether each node is allocated its own 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 node_public_ip_prefix_id: The public IP prefix ID which VM nodes should use IPs from. - 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.models.ScaleSetPriority - :ivar scale_set_eviction_policy: The Virtual Machine Scale Set eviction policy to use. 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.models.ScaleSetEvictionPolicy - :ivar spot_max_price: The max price (in US Dollars) you are willing to pay for spot instances. - Possible values are any decimal value greater than zero or -1 which indicates default price to - be up-to on-demand. Possible values are any decimal value greater than zero or -1 which - indicates the willingness to pay any on-demand price. For more details on spot pricing, see - `spot VMs pricing `_. - :vartype spot_max_price: float - :ivar tags: The tags to be persisted on the agent pool virtual machine scale set. - :vartype tags: dict[str, str] - :ivar node_labels: The node labels to be persisted across all nodes in agent pool. - :vartype node_labels: dict[str, str] - :ivar node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :vartype node_taints: list[str] - :ivar node_initialization_taints: Taints added on the nodes during creation that will not be - reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl - call. This field can be modified after node pool is created, but nodes will not be recreated - with new taints until another operation that requires recreation (e.g. node image upgrade) - happens. These taints allow for required configuration to run before the node is ready to - accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl - taint nodes node1 key1=value1:NoSchedule-``. - :vartype node_initialization_taints: list[str] - :ivar proximity_placement_group_id: The ID for Proximity Placement Group. - :vartype proximity_placement_group_id: str - :ivar kubelet_config: The Kubelet configuration on the agent pool nodes. - :vartype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig - :ivar linux_os_config: The OS configuration of Linux agent nodes. - :vartype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig - :ivar enable_encryption_at_host: Whether to enable host based OS and data drive encryption. - 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: Whether to use a FIPS-enabled OS. 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.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.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: The fully qualified resource ID of the Dedicated Host Group to provision - virtual machines from, used only in creation scenario and not allowed to changed once set. 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.models.AgentPoolWindowsProfile - :ivar network_profile: Network-related settings of an agent pool. - :vartype network_profile: ~azure.mgmt.containerservice.models.AgentPoolNetworkProfile - :ivar security_profile: The security settings of an agent pool. - :vartype security_profile: ~azure.mgmt.containerservice.models.AgentPoolSecurityProfile - :ivar gpu_profile: The GPU settings of an agent pool. - :vartype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile - :ivar artifact_streaming_profile: Configuration for using artifact streaming on AKS. - :vartype artifact_streaming_profile: - ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile - :ivar virtual_machines_profile: Specifications on VirtualMachines agent pool. - :vartype virtual_machines_profile: ~azure.mgmt.containerservice.models.VirtualMachinesProfile - :ivar virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. - :vartype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.models.VirtualMachineNodes] - :ivar gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field - cannot be set if agent pool mode is not Gateway. - :vartype gateway_profile: ~azure.mgmt.containerservice.models.AgentPoolGatewayProfile - :ivar status: Contains read-only information about the Agent Pool. - :vartype status: ~azure.mgmt.containerservice.models.AgentPoolStatus - :ivar local_dns_profile: Configures the per-node local DNS, with VnetDNS and KubeDNS overrides. - LocalDNS helps improve performance and reliability of DNS resolution in an AKS cluster. For - more details see aka.ms/aks/localdns. - :vartype local_dns_profile: ~azure.mgmt.containerservice.models.LocalDNSProfile - :ivar node_customization_profile: Settings to determine the node customization used to - provision nodes in a pool. - :vartype node_customization_profile: - ~azure.mgmt.containerservice.models.NodeCustomizationProfile - :ivar name: Unique name of the agent pool profile in the context of the subscription and - resource group. Windows agent pool names must be 6 characters or less. Required. - :vartype name: str - """ - - _validation = { - "e_tag": {"readonly": True}, - "os_disk_size_gb": {"maximum": 2048, "minimum": 0}, - "current_orchestrator_version": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "name": {"required": True, "pattern": r"^[a-z][a-z0-9]{0,11}$"}, - } - - _attribute_map = { - "e_tag": {"key": "eTag", "type": "str"}, - "count": {"key": "count", "type": "int"}, - "vm_size": {"key": "vmSize", "type": "str"}, - "os_disk_size_gb": {"key": "osDiskSizeGB", "type": "int"}, - "os_disk_type": {"key": "osDiskType", "type": "str"}, - "kubelet_disk_type": {"key": "kubeletDiskType", "type": "str"}, - "workload_runtime": {"key": "workloadRuntime", "type": "str"}, - "message_of_the_day": {"key": "messageOfTheDay", "type": "str"}, - "vnet_subnet_id": {"key": "vnetSubnetID", "type": "str"}, - "pod_subnet_id": {"key": "podSubnetID", "type": "str"}, - "pod_ip_allocation_mode": {"key": "podIPAllocationMode", "type": "str"}, - "max_pods": {"key": "maxPods", "type": "int"}, - "os_type": {"key": "osType", "type": "str"}, - "os_sku": {"key": "osSKU", "type": "str"}, - "max_count": {"key": "maxCount", "type": "int"}, - "min_count": {"key": "minCount", "type": "int"}, - "enable_auto_scaling": {"key": "enableAutoScaling", "type": "bool"}, - "scale_down_mode": {"key": "scaleDownMode", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "mode": {"key": "mode", "type": "str"}, - "orchestrator_version": {"key": "orchestratorVersion", "type": "str"}, - "current_orchestrator_version": {"key": "currentOrchestratorVersion", "type": "str"}, - "node_image_version": {"key": "nodeImageVersion", "type": "str"}, - "upgrade_strategy": {"key": "upgradeStrategy", "type": "str"}, - "upgrade_settings": {"key": "upgradeSettings", "type": "AgentPoolUpgradeSettings"}, - "upgrade_settings_blue_green": {"key": "upgradeSettingsBlueGreen", "type": "AgentPoolBlueGreenUpgradeSettings"}, - "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"}, - "node_public_ip_prefix_id": {"key": "nodePublicIPPrefixID", "type": "str"}, - "scale_set_priority": {"key": "scaleSetPriority", "type": "str"}, - "scale_set_eviction_policy": {"key": "scaleSetEvictionPolicy", "type": "str"}, - "spot_max_price": {"key": "spotMaxPrice", "type": "float"}, - "tags": {"key": "tags", "type": "{str}"}, - "node_labels": {"key": "nodeLabels", "type": "{str}"}, - "node_taints": {"key": "nodeTaints", "type": "[str]"}, - "node_initialization_taints": {"key": "nodeInitializationTaints", "type": "[str]"}, - "proximity_placement_group_id": {"key": "proximityPlacementGroupID", "type": "str"}, - "kubelet_config": {"key": "kubeletConfig", "type": "KubeletConfig"}, - "linux_os_config": {"key": "linuxOSConfig", "type": "LinuxOSConfig"}, - "enable_encryption_at_host": {"key": "enableEncryptionAtHost", "type": "bool"}, - "enable_ultra_ssd": {"key": "enableUltraSSD", "type": "bool"}, - "enable_fips": {"key": "enableFIPS", "type": "bool"}, - "gpu_instance_profile": {"key": "gpuInstanceProfile", "type": "str"}, - "creation_data": {"key": "creationData", "type": "CreationData"}, - "capacity_reservation_group_id": {"key": "capacityReservationGroupID", "type": "str"}, - "host_group_id": {"key": "hostGroupID", "type": "str"}, - "windows_profile": {"key": "windowsProfile", "type": "AgentPoolWindowsProfile"}, - "network_profile": {"key": "networkProfile", "type": "AgentPoolNetworkProfile"}, - "security_profile": {"key": "securityProfile", "type": "AgentPoolSecurityProfile"}, - "gpu_profile": {"key": "gpuProfile", "type": "GPUProfile"}, - "artifact_streaming_profile": {"key": "artifactStreamingProfile", "type": "AgentPoolArtifactStreamingProfile"}, - "virtual_machines_profile": {"key": "virtualMachinesProfile", "type": "VirtualMachinesProfile"}, - "virtual_machine_nodes_status": {"key": "virtualMachineNodesStatus", "type": "[VirtualMachineNodes]"}, - "gateway_profile": {"key": "gatewayProfile", "type": "AgentPoolGatewayProfile"}, - "status": {"key": "status", "type": "AgentPoolStatus"}, - "local_dns_profile": {"key": "localDNSProfile", "type": "LocalDNSProfile"}, - "node_customization_profile": {"key": "nodeCustomizationProfile", "type": "NodeCustomizationProfile"}, - "name": {"key": "name", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - name: str, - count: Optional[int] = None, - vm_size: Optional[str] = None, - os_disk_size_gb: Optional[int] = None, - os_disk_type: Optional[Union[str, "_models.OSDiskType"]] = None, - kubelet_disk_type: Optional[Union[str, "_models.KubeletDiskType"]] = None, - workload_runtime: Optional[Union[str, "_models.WorkloadRuntime"]] = None, - message_of_the_day: Optional[str] = None, - vnet_subnet_id: Optional[str] = None, - pod_subnet_id: Optional[str] = None, - pod_ip_allocation_mode: Optional[Union[str, "_models.PodIPAllocationMode"]] = None, - max_pods: Optional[int] = None, - os_type: Union[str, "_models.OSType"] = "Linux", - os_sku: Optional[Union[str, "_models.OSSKU"]] = None, - max_count: Optional[int] = None, - min_count: Optional[int] = None, - enable_auto_scaling: Optional[bool] = None, - scale_down_mode: Optional[Union[str, "_models.ScaleDownMode"]] = None, - type: Optional[Union[str, "_models.AgentPoolType"]] = None, - mode: Optional[Union[str, "_models.AgentPoolMode"]] = None, - orchestrator_version: Optional[str] = None, - node_image_version: Optional[str] = None, - upgrade_strategy: Optional[Union[str, "_models.UpgradeStrategy"]] = None, - upgrade_settings: Optional["_models.AgentPoolUpgradeSettings"] = None, - upgrade_settings_blue_green: Optional["_models.AgentPoolBlueGreenUpgradeSettings"] = None, - power_state: Optional["_models.PowerState"] = None, - availability_zones: Optional[list[str]] = None, - enable_node_public_ip: Optional[bool] = None, - node_public_ip_prefix_id: Optional[str] = None, - scale_set_priority: Union[str, "_models.ScaleSetPriority"] = "Regular", - scale_set_eviction_policy: Union[str, "_models.ScaleSetEvictionPolicy"] = "Delete", - spot_max_price: float = -1, - tags: Optional[dict[str, str]] = None, - node_labels: Optional[dict[str, str]] = None, - node_taints: Optional[list[str]] = None, - node_initialization_taints: Optional[list[str]] = None, - proximity_placement_group_id: Optional[str] = None, - kubelet_config: Optional["_models.KubeletConfig"] = None, - linux_os_config: Optional["_models.LinuxOSConfig"] = None, - enable_encryption_at_host: Optional[bool] = None, - enable_ultra_ssd: Optional[bool] = None, - enable_fips: Optional[bool] = None, - gpu_instance_profile: Optional[Union[str, "_models.GPUInstanceProfile"]] = None, - creation_data: Optional["_models.CreationData"] = None, - capacity_reservation_group_id: Optional[str] = None, - host_group_id: Optional[str] = None, - windows_profile: Optional["_models.AgentPoolWindowsProfile"] = None, - network_profile: Optional["_models.AgentPoolNetworkProfile"] = None, - security_profile: Optional["_models.AgentPoolSecurityProfile"] = None, - gpu_profile: Optional["_models.GPUProfile"] = None, - artifact_streaming_profile: Optional["_models.AgentPoolArtifactStreamingProfile"] = None, - virtual_machines_profile: Optional["_models.VirtualMachinesProfile"] = None, - virtual_machine_nodes_status: Optional[list["_models.VirtualMachineNodes"]] = None, - gateway_profile: Optional["_models.AgentPoolGatewayProfile"] = None, - status: Optional["_models.AgentPoolStatus"] = None, - local_dns_profile: Optional["_models.LocalDNSProfile"] = None, - node_customization_profile: Optional["_models.NodeCustomizationProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword count: Number of agents (VMs) to host docker containers. Allowed values must be in the - range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for - system pools. The default value is 1. - :paramtype count: int - :keyword vm_size: The size of the agent pool VMs. 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 OS disk type to be used for machines in the agent pool. 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.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.models.KubeletDiskType - :keyword workload_runtime: Determines the type of workload a node can run. Known values are: - "OCIContainer", "WasmWasi", "KataMshvVmIsolation", and "KataVmIsolation". - :paramtype workload_runtime: str or ~azure.mgmt.containerservice.models.WorkloadRuntime - :keyword message_of_the_day: Message of the day for Linux nodes, base64-encoded. 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: The ID of the subnet which agent pool nodes and optionally pods will - join on startup. 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: The ID of the subnet which pods will join when launched. 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 pod_ip_allocation_mode: Pod IP Allocation Mode. The IP allocation mode for pods in the - agent pool. Must be used with podSubnetId. The default is 'DynamicIndividual'. Known values - are: "DynamicIndividual" and "StaticBlock". - :paramtype pod_ip_allocation_mode: str or - ~azure.mgmt.containerservice.models.PodIPAllocationMode - :keyword max_pods: The maximum number of pods that can run on a node. - :paramtype max_pods: int - :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" - and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.models.OSType - :keyword os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is - Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be - changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", - "AzureLinux", "AzureLinux3", "Flatcar", "CBLMariner", "Windows2019", "Windows2022", - "Windows2025", "WindowsAnnual", "Ubuntu2204", and "Ubuntu2404". - :paramtype os_sku: str or ~azure.mgmt.containerservice.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: The scale down mode to use when scaling the Agent Pool. 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.models.ScaleDownMode - :keyword type: The type of Agent Pool. Known values are: "VirtualMachineScaleSets", - "AvailabilitySet", and "VirtualMachines". - :paramtype type: str or ~azure.mgmt.containerservice.models.AgentPoolType - :keyword mode: The mode of an agent pool. A cluster must have at least one 'System' Agent Pool - at all times. For additional information on agent pool restrictions and best practices, see: - https://docs.microsoft.com/azure/aks/use-system-pools. Known values are: "System", "User", - "Gateway", "ManagedSystem", and "Machines". - :paramtype mode: str or ~azure.mgmt.containerservice.models.AgentPoolMode - :keyword orchestrator_version: The version of Kubernetes specified by the user. 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 node_image_version: The version of node image. - :paramtype node_image_version: str - :keyword upgrade_strategy: Defines the upgrade strategy for the agent pool. The default is - Rolling. Known values are: "Rolling" and "BlueGreen". - :paramtype upgrade_strategy: str or ~azure.mgmt.containerservice.models.UpgradeStrategy - :keyword upgrade_settings: Settings for upgrading the agentpool. Applies when upgrade strategy - is set to Rolling. - :paramtype upgrade_settings: ~azure.mgmt.containerservice.models.AgentPoolUpgradeSettings - :keyword upgrade_settings_blue_green: Settings for Blue-Green upgrade on the agentpool. Applies - when upgrade strategy is set to BlueGreen. - :paramtype upgrade_settings_blue_green: - ~azure.mgmt.containerservice.models.AgentPoolBlueGreenUpgradeSettings - :keyword power_state: Whether the Agent Pool is running or stopped. 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.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: Whether each node is allocated its own 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 node_public_ip_prefix_id: The public IP prefix ID which VM nodes should use IPs from. - 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.models.ScaleSetPriority - :keyword scale_set_eviction_policy: The Virtual Machine Scale Set eviction policy to use. 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.models.ScaleSetEvictionPolicy - :keyword spot_max_price: The max price (in US Dollars) you are willing to pay for spot - instances. Possible values are any decimal value greater than zero or -1 which indicates - default price to be up-to on-demand. Possible values are any decimal value greater than zero or - -1 which indicates the willingness to pay any on-demand price. For more details on spot - pricing, see `spot VMs pricing - `_. - :paramtype spot_max_price: float - :keyword tags: The tags to be persisted on the agent pool virtual machine scale set. - :paramtype tags: dict[str, str] - :keyword node_labels: The node labels to be persisted across all nodes in agent pool. - :paramtype node_labels: dict[str, str] - :keyword node_taints: The taints added to new nodes during node pool create and scale. For - example, key=value:NoSchedule. - :paramtype node_taints: list[str] - :keyword node_initialization_taints: Taints added on the nodes during creation that will not be - reconciled by AKS. These taints will not be reconciled by AKS and can be removed with a kubectl - call. This field can be modified after node pool is created, but nodes will not be recreated - with new taints until another operation that requires recreation (e.g. node image upgrade) - happens. These taints allow for required configuration to run before the node is ready to - accept workloads, for example 'key1=value1:NoSchedule' that then can be removed with ``kubectl - taint nodes node1 key1=value1:NoSchedule-``. - :paramtype node_initialization_taints: list[str] - :keyword proximity_placement_group_id: The ID for Proximity Placement Group. - :paramtype proximity_placement_group_id: str - :keyword kubelet_config: The Kubelet configuration on the agent pool nodes. - :paramtype kubelet_config: ~azure.mgmt.containerservice.models.KubeletConfig - :keyword linux_os_config: The OS configuration of Linux agent nodes. - :paramtype linux_os_config: ~azure.mgmt.containerservice.models.LinuxOSConfig - :keyword enable_encryption_at_host: Whether to enable host based OS and data drive encryption. - 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: Whether to use a FIPS-enabled OS. 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.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.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: The fully qualified resource ID of the Dedicated Host Group to - provision virtual machines from, used only in creation scenario and not allowed to changed once - set. 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.models.AgentPoolWindowsProfile - :keyword network_profile: Network-related settings of an agent pool. - :paramtype network_profile: ~azure.mgmt.containerservice.models.AgentPoolNetworkProfile - :keyword security_profile: The security settings of an agent pool. - :paramtype security_profile: ~azure.mgmt.containerservice.models.AgentPoolSecurityProfile - :keyword gpu_profile: The GPU settings of an agent pool. - :paramtype gpu_profile: ~azure.mgmt.containerservice.models.GPUProfile - :keyword artifact_streaming_profile: Configuration for using artifact streaming on AKS. - :paramtype artifact_streaming_profile: - ~azure.mgmt.containerservice.models.AgentPoolArtifactStreamingProfile - :keyword virtual_machines_profile: Specifications on VirtualMachines agent pool. - :paramtype virtual_machines_profile: ~azure.mgmt.containerservice.models.VirtualMachinesProfile - :keyword virtual_machine_nodes_status: The status of nodes in a VirtualMachines agent pool. - :paramtype virtual_machine_nodes_status: - list[~azure.mgmt.containerservice.models.VirtualMachineNodes] - :keyword gateway_profile: Profile specific to a managed agent pool in Gateway mode. This field - cannot be set if agent pool mode is not Gateway. - :paramtype gateway_profile: ~azure.mgmt.containerservice.models.AgentPoolGatewayProfile - :keyword status: Contains read-only information about the Agent Pool. - :paramtype status: ~azure.mgmt.containerservice.models.AgentPoolStatus - :keyword local_dns_profile: Configures the per-node local DNS, with VnetDNS and KubeDNS - overrides. LocalDNS helps improve performance and reliability of DNS resolution in an AKS - cluster. For more details see aka.ms/aks/localdns. - :paramtype local_dns_profile: ~azure.mgmt.containerservice.models.LocalDNSProfile - :keyword node_customization_profile: Settings to determine the node customization used to - provision nodes in a pool. - :paramtype node_customization_profile: - ~azure.mgmt.containerservice.models.NodeCustomizationProfile - :keyword name: Unique name of the agent pool profile in the context of the subscription and - resource group. Windows agent pool names must be 6 characters or less. Required. - :paramtype name: str - """ - super().__init__( - count=count, - vm_size=vm_size, - os_disk_size_gb=os_disk_size_gb, - os_disk_type=os_disk_type, - kubelet_disk_type=kubelet_disk_type, - workload_runtime=workload_runtime, - message_of_the_day=message_of_the_day, - vnet_subnet_id=vnet_subnet_id, - pod_subnet_id=pod_subnet_id, - pod_ip_allocation_mode=pod_ip_allocation_mode, - max_pods=max_pods, - os_type=os_type, - os_sku=os_sku, - max_count=max_count, - min_count=min_count, - enable_auto_scaling=enable_auto_scaling, - scale_down_mode=scale_down_mode, - type=type, - mode=mode, - orchestrator_version=orchestrator_version, - node_image_version=node_image_version, - upgrade_strategy=upgrade_strategy, - upgrade_settings=upgrade_settings, - upgrade_settings_blue_green=upgrade_settings_blue_green, - power_state=power_state, - availability_zones=availability_zones, - enable_node_public_ip=enable_node_public_ip, - node_public_ip_prefix_id=node_public_ip_prefix_id, - scale_set_priority=scale_set_priority, - scale_set_eviction_policy=scale_set_eviction_policy, - spot_max_price=spot_max_price, - tags=tags, - node_labels=node_labels, - node_taints=node_taints, - node_initialization_taints=node_initialization_taints, - proximity_placement_group_id=proximity_placement_group_id, - kubelet_config=kubelet_config, - linux_os_config=linux_os_config, - enable_encryption_at_host=enable_encryption_at_host, - enable_ultra_ssd=enable_ultra_ssd, - enable_fips=enable_fips, - gpu_instance_profile=gpu_instance_profile, - creation_data=creation_data, - capacity_reservation_group_id=capacity_reservation_group_id, - host_group_id=host_group_id, - windows_profile=windows_profile, - network_profile=network_profile, - security_profile=security_profile, - gpu_profile=gpu_profile, - artifact_streaming_profile=artifact_streaming_profile, - virtual_machines_profile=virtual_machines_profile, - virtual_machine_nodes_status=virtual_machine_nodes_status, - gateway_profile=gateway_profile, - status=status, - local_dns_profile=local_dns_profile, - node_customization_profile=node_customization_profile, - **kwargs - ) - self.name = name - - -class ManagedClusterAIToolchainOperatorProfile(_serialization.Model): - """When enabling the operator, a set of AKS managed CRDs and controllers will be installed in the - cluster. The operator automates the deployment of OSS models for inference and/or training - purposes. It provides a set of preset models and enables distributed inference against them. - - :ivar enabled: Whether to enable AI toolchain operator to the cluster. Indicates if AI - toolchain operator enabled or not. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable AI toolchain operator to the cluster. Indicates if AI - toolchain operator enabled or not. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterAPIServerAccessProfile(_serialization.Model): - """Access profile for managed cluster API server. - - :ivar authorized_ip_ranges: The IP ranges authorized to access the Kubernetes API server. 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: Whether to create the cluster as a private cluster or not. For - more details, see `Creating a private AKS cluster - `_. - :vartype enable_private_cluster: bool - :ivar private_dns_zone: The private DNS zone mode for the cluster. 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: The subnet to be used when apiserver vnet integration is enabled. It is - required when: 1. creating a new cluster with BYO Vnet; 2. updating an existing cluster to - enable apiserver vnet integration. - :vartype subnet_id: str - """ - - _attribute_map = { - "authorized_ip_ranges": {"key": "authorizedIPRanges", "type": "[str]"}, - "enable_private_cluster": {"key": "enablePrivateCluster", "type": "bool"}, - "private_dns_zone": {"key": "privateDNSZone", "type": "str"}, - "enable_private_cluster_public_fqdn": {"key": "enablePrivateClusterPublicFQDN", "type": "bool"}, - "disable_run_command": {"key": "disableRunCommand", "type": "bool"}, - "enable_vnet_integration": {"key": "enableVnetIntegration", "type": "bool"}, - "subnet_id": {"key": "subnetId", "type": "str"}, - } - - def __init__( - self, - *, - authorized_ip_ranges: Optional[list[str]] = None, - enable_private_cluster: Optional[bool] = None, - private_dns_zone: Optional[str] = None, - enable_private_cluster_public_fqdn: Optional[bool] = None, - disable_run_command: Optional[bool] = None, - enable_vnet_integration: Optional[bool] = None, - subnet_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword authorized_ip_ranges: The IP ranges authorized to access the Kubernetes API server. 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: Whether to create the cluster as a private cluster or not. For - more details, see `Creating a private AKS cluster - `_. - :paramtype enable_private_cluster: bool - :keyword private_dns_zone: The private DNS zone mode for the cluster. 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: The subnet to be used when apiserver vnet integration is enabled. 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: The upgrade channel for auto upgrade. The default is 'none'. 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.models.UpgradeChannel - :ivar node_os_upgrade_channel: Manner in which the OS on your nodes is updated. The default is - Unmanaged, but may change to either NodeImage or SecurityPatch at GA. Known values are: "None", - "Unmanaged", "SecurityPatch", and "NodeImage". - :vartype node_os_upgrade_channel: str or - ~azure.mgmt.containerservice.models.NodeOSUpgradeChannel - """ - - _attribute_map = { - "upgrade_channel": {"key": "upgradeChannel", "type": "str"}, - "node_os_upgrade_channel": {"key": "nodeOSUpgradeChannel", "type": "str"}, - } - - def __init__( - self, - *, - upgrade_channel: Optional[Union[str, "_models.UpgradeChannel"]] = None, - node_os_upgrade_channel: Optional[Union[str, "_models.NodeOSUpgradeChannel"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword upgrade_channel: The upgrade channel for auto upgrade. The default is 'none'. 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.models.UpgradeChannel - :keyword node_os_upgrade_channel: Manner in which the OS on your nodes is updated. The default - is Unmanaged, but may change to either NodeImage or SecurityPatch at GA. Known values are: - "None", "Unmanaged", "SecurityPatch", and "NodeImage". - :paramtype node_os_upgrade_channel: str or - ~azure.mgmt.containerservice.models.NodeOSUpgradeChannel - """ - super().__init__(**kwargs) - self.upgrade_channel = upgrade_channel - self.node_os_upgrade_channel = node_os_upgrade_channel - - -class ManagedClusterAzureMonitorProfile(_serialization.Model): - """Prometheus addon profile for the container service cluster. - - :ivar metrics: Metrics profile for the prometheus service addon. - :vartype metrics: ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileMetrics - :ivar container_insights: Azure Monitor Container Insights Profile for Kubernetes Events, - Inventory and Container stdout & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for - an overview. - :vartype container_insights: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileContainerInsights - :ivar app_monitoring: Application Monitoring Profile for Kubernetes Application Container. - Collects application logs, metrics and traces through auto-instrumentation of the application - using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for - an overview. - :vartype app_monitoring: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoring - """ - - _attribute_map = { - "metrics": {"key": "metrics", "type": "ManagedClusterAzureMonitorProfileMetrics"}, - "container_insights": { - "key": "containerInsights", - "type": "ManagedClusterAzureMonitorProfileContainerInsights", - }, - "app_monitoring": {"key": "appMonitoring", "type": "ManagedClusterAzureMonitorProfileAppMonitoring"}, - } - - def __init__( - self, - *, - metrics: Optional["_models.ManagedClusterAzureMonitorProfileMetrics"] = None, - container_insights: Optional["_models.ManagedClusterAzureMonitorProfileContainerInsights"] = None, - app_monitoring: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoring"] = None, - **kwargs: Any - ) -> None: - """ - :keyword metrics: Metrics profile for the prometheus service addon. - :paramtype metrics: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileMetrics - :keyword container_insights: Azure Monitor Container Insights Profile for Kubernetes Events, - Inventory and Container stdout & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for - an overview. - :paramtype container_insights: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileContainerInsights - :keyword app_monitoring: Application Monitoring Profile for Kubernetes Application Container. - Collects application logs, metrics and traces through auto-instrumentation of the application - using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for - an overview. - :paramtype app_monitoring: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoring - """ - super().__init__(**kwargs) - self.metrics = metrics - self.container_insights = container_insights - self.app_monitoring = app_monitoring - - -class ManagedClusterAzureMonitorProfileAppMonitoring(_serialization.Model): # pylint: disable=name-too-long - """Application Monitoring Profile for Kubernetes Application Container. Collects application logs, - metrics and traces through auto-instrumentation of the application using Azure Monitor - OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. - - :ivar auto_instrumentation: Application Monitoring Auto Instrumentation for Kubernetes - Application Container. Deploys web hook to auto-instrument Azure Monitor OpenTelemetry based - SDKs to collect OpenTelemetry metrics, logs and traces of the application. See - aka.ms/AzureMonitorApplicationMonitoring for an overview. - :vartype auto_instrumentation: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation - :ivar open_telemetry_metrics: Application Monitoring Open Telemetry Metrics Profile for - Kubernetes Application Container Metrics. Collects OpenTelemetry metrics of the application - using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for - an overview. - :vartype open_telemetry_metrics: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics - :ivar open_telemetry_logs: Application Monitoring Open Telemetry Metrics Profile for Kubernetes - Application Container Logs and Traces. Collects OpenTelemetry logs and traces of the - application using Azure Monitor OpenTelemetry based SDKs. See - aka.ms/AzureMonitorApplicationMonitoring for an overview. - :vartype open_telemetry_logs: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs - """ - - _attribute_map = { - "auto_instrumentation": { - "key": "autoInstrumentation", - "type": "ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation", - }, - "open_telemetry_metrics": { - "key": "openTelemetryMetrics", - "type": "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics", - }, - "open_telemetry_logs": { - "key": "openTelemetryLogs", - "type": "ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs", - }, - } - - def __init__( - self, - *, - auto_instrumentation: Optional[ - "_models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation" - ] = None, - open_telemetry_metrics: Optional[ - "_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics" - ] = None, - open_telemetry_logs: Optional["_models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs"] = None, - **kwargs: Any - ) -> None: - """ - :keyword auto_instrumentation: Application Monitoring Auto Instrumentation for Kubernetes - Application Container. Deploys web hook to auto-instrument Azure Monitor OpenTelemetry based - SDKs to collect OpenTelemetry metrics, logs and traces of the application. See - aka.ms/AzureMonitorApplicationMonitoring for an overview. - :paramtype auto_instrumentation: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation - :keyword open_telemetry_metrics: Application Monitoring Open Telemetry Metrics Profile for - Kubernetes Application Container Metrics. Collects OpenTelemetry metrics of the application - using Azure Monitor OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for - an overview. - :paramtype open_telemetry_metrics: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics - :keyword open_telemetry_logs: Application Monitoring Open Telemetry Metrics Profile for - Kubernetes Application Container Logs and Traces. Collects OpenTelemetry logs and traces of the - application using Azure Monitor OpenTelemetry based SDKs. See - aka.ms/AzureMonitorApplicationMonitoring for an overview. - :paramtype open_telemetry_logs: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs - """ - super().__init__(**kwargs) - self.auto_instrumentation = auto_instrumentation - self.open_telemetry_metrics = open_telemetry_metrics - self.open_telemetry_logs = open_telemetry_logs - - -class ManagedClusterAzureMonitorProfileAppMonitoringAutoInstrumentation( - _serialization.Model -): # pylint: disable=name-too-long - """Application Monitoring Auto Instrumentation for Kubernetes Application Container. Deploys web - hook to auto-instrument Azure Monitor OpenTelemetry based SDKs to collect OpenTelemetry - metrics, logs and traces of the application. See aka.ms/AzureMonitorApplicationMonitoring for - an overview. - - :ivar enabled: Indicates if Application Monitoring Auto Instrumentation is enabled or not. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Indicates if Application Monitoring Auto Instrumentation is enabled or not. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryLogs( - _serialization.Model -): # pylint: disable=name-too-long - """Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container Logs - and Traces. Collects OpenTelemetry logs and traces of the application using Azure Monitor - OpenTelemetry based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. - - :ivar enabled: Indicates if Application Monitoring Open Telemetry Logs and traces is enabled or - not. - :vartype enabled: bool - :ivar port: The Open Telemetry host port for Open Telemetry logs and traces. If not specified, - the default port is 28331. - :vartype port: int - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "port": {"key": "port", "type": "int"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, port: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Indicates if Application Monitoring Open Telemetry Logs and traces is enabled - or not. - :paramtype enabled: bool - :keyword port: The Open Telemetry host port for Open Telemetry logs and traces. If not - specified, the default port is 28331. - :paramtype port: int - """ - super().__init__(**kwargs) - self.enabled = enabled - self.port = port - - -class ManagedClusterAzureMonitorProfileAppMonitoringOpenTelemetryMetrics( - _serialization.Model -): # pylint: disable=name-too-long - """Application Monitoring Open Telemetry Metrics Profile for Kubernetes Application Container - Metrics. Collects OpenTelemetry metrics of the application using Azure Monitor OpenTelemetry - based SDKs. See aka.ms/AzureMonitorApplicationMonitoring for an overview. - - :ivar enabled: Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. - :vartype enabled: bool - :ivar port: The Open Telemetry host port for Open Telemetry metrics. If not specified, the - default port is 28333. - :vartype port: int - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "port": {"key": "port", "type": "int"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, port: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Indicates if Application Monitoring Open Telemetry Metrics is enabled or not. - :paramtype enabled: bool - :keyword port: The Open Telemetry host port for Open Telemetry metrics. If not specified, the - default port is 28333. - :paramtype port: int - """ - super().__init__(**kwargs) - self.enabled = enabled - self.port = port - - -class ManagedClusterAzureMonitorProfileContainerInsights(_serialization.Model): # pylint: disable=name-too-long - """Azure Monitor Container Insights Profile for Kubernetes Events, Inventory and Container stdout - & stderr logs etc. See aka.ms/AzureMonitorContainerInsights for an overview. - - :ivar enabled: Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. - :vartype enabled: bool - :ivar log_analytics_workspace_resource_id: Fully Qualified ARM Resource Id of Azure Log - Analytics Workspace for storing Azure Monitor Container Insights Logs. - :vartype log_analytics_workspace_resource_id: str - :ivar syslog_port: The syslog host port. If not specified, the default port is 28330. - :vartype syslog_port: int - :ivar disable_custom_metrics: Indicates whether custom metrics collection has to be disabled or - not. If not specified the default is false. No custom metrics will be emitted if this field is - false but the container insights enabled field is false. - :vartype disable_custom_metrics: bool - :ivar disable_prometheus_metrics_scraping: Indicates whether prometheus metrics scraping is - disabled or not. If not specified the default is false. No prometheus metrics will be emitted - if this field is false but the container insights enabled field is false. - :vartype disable_prometheus_metrics_scraping: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "log_analytics_workspace_resource_id": {"key": "logAnalyticsWorkspaceResourceId", "type": "str"}, - "syslog_port": {"key": "syslogPort", "type": "int"}, - "disable_custom_metrics": {"key": "disableCustomMetrics", "type": "bool"}, - "disable_prometheus_metrics_scraping": {"key": "disablePrometheusMetricsScraping", "type": "bool"}, - } - - def __init__( - self, - *, - enabled: Optional[bool] = None, - log_analytics_workspace_resource_id: Optional[str] = None, - syslog_port: Optional[int] = None, - disable_custom_metrics: Optional[bool] = None, - disable_prometheus_metrics_scraping: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Indicates if Azure Monitor Container Insights Logs Addon is enabled or not. - :paramtype enabled: bool - :keyword log_analytics_workspace_resource_id: Fully Qualified ARM Resource Id of Azure Log - Analytics Workspace for storing Azure Monitor Container Insights Logs. - :paramtype log_analytics_workspace_resource_id: str - :keyword syslog_port: The syslog host port. If not specified, the default port is 28330. - :paramtype syslog_port: int - :keyword disable_custom_metrics: Indicates whether custom metrics collection has to be disabled - or not. If not specified the default is false. No custom metrics will be emitted if this field - is false but the container insights enabled field is false. - :paramtype disable_custom_metrics: bool - :keyword disable_prometheus_metrics_scraping: Indicates whether prometheus metrics scraping is - disabled or not. If not specified the default is false. No prometheus metrics will be emitted - if this field is false but the container insights enabled field is false. - :paramtype disable_prometheus_metrics_scraping: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id - self.syslog_port = syslog_port - self.disable_custom_metrics = disable_custom_metrics - self.disable_prometheus_metrics_scraping = disable_prometheus_metrics_scraping - - -class ManagedClusterAzureMonitorProfileKubeStateMetrics(_serialization.Model): # pylint: disable=name-too-long - """Kube State Metrics for prometheus addon profile for the container service cluster. - - :ivar metric_labels_allowlist: Comma-separated list of Kubernetes annotations keys that will be - used in the resource's labels metric. - :vartype metric_labels_allowlist: str - :ivar metric_annotations_allow_list: Comma-separated list of additional Kubernetes label keys - that will be used in the resource's labels metric. - :vartype metric_annotations_allow_list: str - """ - - _attribute_map = { - "metric_labels_allowlist": {"key": "metricLabelsAllowlist", "type": "str"}, - "metric_annotations_allow_list": {"key": "metricAnnotationsAllowList", "type": "str"}, - } - - def __init__( - self, - *, - metric_labels_allowlist: Optional[str] = None, - metric_annotations_allow_list: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword metric_labels_allowlist: Comma-separated list of Kubernetes annotations keys that will - be used in the resource's labels metric. - :paramtype metric_labels_allowlist: str - :keyword metric_annotations_allow_list: Comma-separated list of additional Kubernetes label - keys that will be used in the resource's labels metric. - :paramtype metric_annotations_allow_list: str - """ - super().__init__(**kwargs) - self.metric_labels_allowlist = metric_labels_allowlist - self.metric_annotations_allow_list = metric_annotations_allow_list - - -class ManagedClusterAzureMonitorProfileMetrics(_serialization.Model): - """Metrics profile for the prometheus service addon. - - All required parameters must be populated in order to send to server. - - :ivar enabled: Whether to enable the Prometheus collector. Required. - :vartype enabled: bool - :ivar kube_state_metrics: Kube State Metrics for prometheus addon profile for the container - service cluster. - :vartype kube_state_metrics: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileKubeStateMetrics - """ - - _validation = { - "enabled": {"required": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "kube_state_metrics": {"key": "kubeStateMetrics", "type": "ManagedClusterAzureMonitorProfileKubeStateMetrics"}, - } - - def __init__( - self, - *, - enabled: bool, - kube_state_metrics: Optional["_models.ManagedClusterAzureMonitorProfileKubeStateMetrics"] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Whether to enable the Prometheus collector. Required. - :paramtype enabled: bool - :keyword kube_state_metrics: Kube State Metrics for prometheus addon profile for the container - service cluster. - :paramtype kube_state_metrics: - ~azure.mgmt.containerservice.models.ManagedClusterAzureMonitorProfileKubeStateMetrics - """ - super().__init__(**kwargs) - self.enabled = enabled - self.kube_state_metrics = kube_state_metrics - - -class ManagedClusterBootstrapProfile(_serialization.Model): - """The bootstrap profile. - - :ivar artifact_source: The artifact source. The source where the artifacts are downloaded from. - Known values are: "Cache" and "Direct". - :vartype artifact_source: str or ~azure.mgmt.containerservice.models.ArtifactSource - :ivar container_registry_id: The resource Id of Azure Container Registry. The registry must - have private network access, premium SKU and zone redundancy. - :vartype container_registry_id: str - """ - - _attribute_map = { - "artifact_source": {"key": "artifactSource", "type": "str"}, - "container_registry_id": {"key": "containerRegistryId", "type": "str"}, - } - - def __init__( - self, - *, - artifact_source: Union[str, "_models.ArtifactSource"] = "Direct", - container_registry_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword artifact_source: The artifact source. The source where the artifacts are downloaded - from. Known values are: "Cache" and "Direct". - :paramtype artifact_source: str or ~azure.mgmt.containerservice.models.ArtifactSource - :keyword container_registry_id: The resource Id of Azure Container Registry. The registry must - have private network access, premium SKU and zone redundancy. - :paramtype container_registry_id: str - """ - super().__init__(**kwargs) - self.artifact_source = artifact_source - self.container_registry_id = container_registry_id - - -class ManagedClusterCostAnalysis(_serialization.Model): - """The cost analysis configuration for the cluster. - - :ivar enabled: Whether to enable cost analysis. The Managed Cluster sku.tier must be set to - 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and - Deployment details to the Cost Analysis views in the Azure portal. If not specified, the - default is false. For more information see aka.ms/aks/docs/cost-analysis. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable cost analysis. The Managed Cluster sku.tier must be set to - 'Standard' or 'Premium' to enable this feature. Enabling this will add Kubernetes Namespace and - Deployment details to the Cost Analysis views in the Azure portal. If not specified, the - default is false. For more information see aka.ms/aks/docs/cost-analysis. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterHostedSystemProfile(_serialization.Model): - """Settings for hosted system addons. - - :ivar enabled: Whether to enable hosted system addons for the cluster. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable hosted system addons for the cluster. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterHTTPProxyConfig(_serialization.Model): - """Cluster HTTP proxy configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar http_proxy: The HTTP proxy server endpoint to use. - :vartype http_proxy: str - :ivar https_proxy: The HTTPS proxy server endpoint to use. - :vartype https_proxy: str - :ivar no_proxy: The endpoints that should not go through proxy. - :vartype no_proxy: list[str] - :ivar effective_no_proxy: A read-only list of all endpoints for which traffic should not be - sent to the proxy. This list is a superset of noProxy and values injected by AKS. - :vartype effective_no_proxy: list[str] - :ivar trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :vartype trusted_ca: str - :ivar enabled: Whether to enable HTTP proxy. When disabled, the specified proxy configuration - will be not be set on pods and nodes. - :vartype enabled: bool - """ - - _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"}, - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__( - self, - *, - http_proxy: Optional[str] = None, - https_proxy: Optional[str] = None, - no_proxy: Optional[list[str]] = None, - trusted_ca: Optional[str] = None, - enabled: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword http_proxy: The HTTP proxy server endpoint to use. - :paramtype http_proxy: str - :keyword https_proxy: The HTTPS proxy server endpoint to use. - :paramtype https_proxy: str - :keyword no_proxy: The endpoints that should not go through proxy. - :paramtype no_proxy: list[str] - :keyword trusted_ca: Alternative CA cert to use for connecting to proxy servers. - :paramtype trusted_ca: str - :keyword enabled: Whether to enable HTTP proxy. When disabled, the specified proxy - configuration will be not be set on pods and nodes. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.http_proxy = http_proxy - self.https_proxy = https_proxy - self.no_proxy = no_proxy - self.effective_no_proxy: Optional[list[str]] = None - self.trusted_ca = trusted_ca - self.enabled = enabled - - -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: The type of identity used for the managed cluster. For more information see `use - managed identities in AKS `_. Known - values are: "SystemAssigned", "UserAssigned", and "None". - :vartype type: str or ~azure.mgmt.containerservice.models.ResourceIdentityType - :ivar delegated_resources: The delegated identity resources assigned to this managed cluster. - This can only be set by another Azure Resource Provider, and managed cluster only accept one - delegated identity resource. Internal use only. - :vartype delegated_resources: dict[str, ~azure.mgmt.containerservice.models.DelegatedResource] - :ivar user_assigned_identities: The user identity associated with the managed cluster. This - identity will be used in control plane. Only one user assigned identity is allowed. 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.models.ManagedServiceIdentityUserAssignedIdentitiesValue] - """ - - _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "delegated_resources": {"key": "delegatedResources", "type": "{DelegatedResource}"}, - "user_assigned_identities": { - "key": "userAssignedIdentities", - "type": "{ManagedServiceIdentityUserAssignedIdentitiesValue}", - }, - } - - def __init__( - self, - *, - type: Optional[Union[str, "_models.ResourceIdentityType"]] = None, - delegated_resources: Optional[dict[str, "_models.DelegatedResource"]] = None, - user_assigned_identities: Optional[ - dict[str, "_models.ManagedServiceIdentityUserAssignedIdentitiesValue"] - ] = None, - **kwargs: Any - ) -> None: - """ - :keyword type: The type of identity used for the managed cluster. For more information see `use - managed identities in AKS `_. Known - values are: "SystemAssigned", "UserAssigned", and "None". - :paramtype type: str or ~azure.mgmt.containerservice.models.ResourceIdentityType - :keyword delegated_resources: The delegated identity resources assigned to this managed - cluster. This can only be set by another Azure Resource Provider, and managed cluster only - accept one delegated identity resource. Internal use only. - :paramtype delegated_resources: dict[str, - ~azure.mgmt.containerservice.models.DelegatedResource] - :keyword user_assigned_identities: The user identity associated with the managed cluster. This - identity will be used in control plane. Only one user assigned identity is allowed. 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.models.ManagedServiceIdentityUserAssignedIdentitiesValue] - """ - super().__init__(**kwargs) - self.principal_id: Optional[str] = None - self.tenant_id: Optional[str] = None - self.type = type - self.delegated_resources = delegated_resources - self.user_assigned_identities = user_assigned_identities - - -class ManagedClusterIngressDefaultDomainProfile(_serialization.Model): # pylint: disable=name-too-long - """ManagedClusterIngressDefaultDomainProfile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar enabled: Whether to enable Default Domain. - :vartype enabled: bool - :ivar domain_name: The unique fully qualified domain name assigned to the cluster. This will - not change even if disabled then reenabled. - :vartype domain_name: str - """ - - _validation = { - "domain_name": {"readonly": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "domain_name": {"key": "domainName", "type": "str"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable Default Domain. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - self.domain_name: Optional[str] = None - - -class ManagedClusterIngressProfile(_serialization.Model): - """Ingress profile for the container service cluster. - - :ivar gateway_api: Settings for the managed Gateway API installation. - :vartype gateway_api: - ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileGatewayConfiguration - :ivar web_app_routing: Web App Routing settings for the ingress profile. - :vartype web_app_routing: - ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileWebAppRouting - :ivar application_load_balancer: Settings for the managed Application Load Balancer - installation. - :vartype application_load_balancer: - ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileApplicationLoadBalancer - """ - - _attribute_map = { - "gateway_api": {"key": "gatewayAPI", "type": "ManagedClusterIngressProfileGatewayConfiguration"}, - "web_app_routing": {"key": "webAppRouting", "type": "ManagedClusterIngressProfileWebAppRouting"}, - "application_load_balancer": { - "key": "applicationLoadBalancer", - "type": "ManagedClusterIngressProfileApplicationLoadBalancer", - }, - } - - def __init__( - self, - *, - gateway_api: Optional["_models.ManagedClusterIngressProfileGatewayConfiguration"] = None, - web_app_routing: Optional["_models.ManagedClusterIngressProfileWebAppRouting"] = None, - application_load_balancer: Optional["_models.ManagedClusterIngressProfileApplicationLoadBalancer"] = None, - **kwargs: Any - ) -> None: - """ - :keyword gateway_api: Settings for the managed Gateway API installation. - :paramtype gateway_api: - ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileGatewayConfiguration - :keyword web_app_routing: Web App Routing settings for the ingress profile. - :paramtype web_app_routing: - ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileWebAppRouting - :keyword application_load_balancer: Settings for the managed Application Load Balancer - installation. - :paramtype application_load_balancer: - ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileApplicationLoadBalancer - """ - super().__init__(**kwargs) - self.gateway_api = gateway_api - self.web_app_routing = web_app_routing - self.application_load_balancer = application_load_balancer - - -class ManagedClusterIngressProfileApplicationLoadBalancer(_serialization.Model): # pylint: disable=name-too-long - """Application Load Balancer settings for the ingress profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar enabled: Whether to enable Application Load Balancer. - :vartype enabled: bool - :ivar identity: Managed identity of the Application Load Balancer add-on. This is the identity - that should be granted permissions to manage the associated Application Gateway for Containers - resource. - :vartype identity: ~azure.mgmt.containerservice.models.UserAssignedIdentity - """ - - _validation = { - "identity": {"readonly": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "identity": {"key": "identity", "type": "UserAssignedIdentity"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable Application Load Balancer. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - self.identity: Optional["_models.UserAssignedIdentity"] = None - - -class ManagedClusterIngressProfileGatewayConfiguration(_serialization.Model): # pylint: disable=name-too-long - """ManagedClusterIngressProfileGatewayConfiguration. - - :ivar installation: Configuration for the managed Gateway API installation. If not specified, - the default is 'Disabled'. See https://aka.ms/k8s-gateway-api for more details. Known values - are: "Disabled" and "Standard". - :vartype installation: str or ~azure.mgmt.containerservice.models.ManagedGatewayType - """ - - _attribute_map = { - "installation": {"key": "installation", "type": "str"}, - } - - def __init__( - self, *, installation: Optional[Union[str, "_models.ManagedGatewayType"]] = None, **kwargs: Any - ) -> None: - """ - :keyword installation: Configuration for the managed Gateway API installation. If not - specified, the default is 'Disabled'. See https://aka.ms/k8s-gateway-api for more details. - Known values are: "Disabled" and "Standard". - :paramtype installation: str or ~azure.mgmt.containerservice.models.ManagedGatewayType - """ - super().__init__(**kwargs) - self.installation = installation - - -class ManagedClusterIngressProfileNginx(_serialization.Model): - """ManagedClusterIngressProfileNginx. - - :ivar default_ingress_controller_type: Ingress type for the default NginxIngressController - custom resource. Known values are: "AnnotationControlled", "External", "Internal", and "None". - :vartype default_ingress_controller_type: str or - ~azure.mgmt.containerservice.models.NginxIngressControllerType - """ - - _attribute_map = { - "default_ingress_controller_type": {"key": "defaultIngressControllerType", "type": "str"}, - } - - def __init__( - self, - *, - default_ingress_controller_type: Optional[Union[str, "_models.NginxIngressControllerType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword default_ingress_controller_type: Ingress type for the default NginxIngressController - custom resource. Known values are: "AnnotationControlled", "External", "Internal", and "None". - :paramtype default_ingress_controller_type: str or - ~azure.mgmt.containerservice.models.NginxIngressControllerType - """ - super().__init__(**kwargs) - self.default_ingress_controller_type = default_ingress_controller_type - - -class ManagedClusterIngressProfileWebAppRouting(_serialization.Model): # pylint: disable=name-too-long - """Web App Routing settings for the ingress profile. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar enabled: Whether to enable Web App Routing. - :vartype enabled: bool - :ivar dns_zone_resource_ids: Resource IDs of the DNS zones to be associated with the Web App - Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be - in different resource groups, but all public DNS zones must be in the same resource group and - all private DNS zones must be in the same resource group. - :vartype dns_zone_resource_ids: list[str] - :ivar nginx: Configuration for the default NginxIngressController. See more at - https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. - :vartype nginx: ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileNginx - :ivar default_domain: Configuration for the Default Domain. This is a unique, autogenerated - domain that comes with a signed TLS Certificate allowing for secure HTTPS. See `the Default - Domain documentation `_ for more instructions. - :vartype default_domain: - ~azure.mgmt.containerservice.models.ManagedClusterIngressDefaultDomainProfile - :ivar identity: Managed identity of the Web Application Routing add-on. This is the identity - that should be granted permissions, for example, to manage the associated Azure DNS resource - and get certificates from Azure Key Vault. See `this overview of the add-on - `_ for more - instructions. - :vartype identity: ~azure.mgmt.containerservice.models.UserAssignedIdentity - """ - - _validation = { - "dns_zone_resource_ids": {"max_items": 5, "min_items": 0}, - "identity": {"readonly": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "dns_zone_resource_ids": {"key": "dnsZoneResourceIds", "type": "[str]"}, - "nginx": {"key": "nginx", "type": "ManagedClusterIngressProfileNginx"}, - "default_domain": {"key": "defaultDomain", "type": "ManagedClusterIngressDefaultDomainProfile"}, - "identity": {"key": "identity", "type": "UserAssignedIdentity"}, - } - - def __init__( - self, - *, - enabled: Optional[bool] = None, - dns_zone_resource_ids: Optional[list[str]] = None, - nginx: Optional["_models.ManagedClusterIngressProfileNginx"] = None, - default_domain: Optional["_models.ManagedClusterIngressDefaultDomainProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Whether to enable Web App Routing. - :paramtype enabled: bool - :keyword dns_zone_resource_ids: Resource IDs of the DNS zones to be associated with the Web App - Routing add-on. Used only when Web App Routing is enabled. Public and private DNS zones can be - in different resource groups, but all public DNS zones must be in the same resource group and - all private DNS zones must be in the same resource group. - :paramtype dns_zone_resource_ids: list[str] - :keyword nginx: Configuration for the default NginxIngressController. See more at - https://learn.microsoft.com/en-us/azure/aks/app-routing-nginx-configuration#the-default-nginx-ingress-controller. - :paramtype nginx: ~azure.mgmt.containerservice.models.ManagedClusterIngressProfileNginx - :keyword default_domain: Configuration for the Default Domain. This is a unique, autogenerated - domain that comes with a signed TLS Certificate allowing for secure HTTPS. See `the Default - Domain documentation `_ for more instructions. - :paramtype default_domain: - ~azure.mgmt.containerservice.models.ManagedClusterIngressDefaultDomainProfile - """ - super().__init__(**kwargs) - self.enabled = enabled - self.dns_zone_resource_ids = dns_zone_resource_ids - self.nginx = nginx - self.default_domain = default_domain - self.identity: Optional["_models.UserAssignedIdentity"] = None - - -class ManagedClusterListResult(_serialization.Model): - """The response from the List Managed Clusters operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of managed clusters. - :vartype value: list[~azure.mgmt.containerservice.models.ManagedCluster] - :ivar next_link: The URL to get the next set of managed cluster results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedCluster]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.ManagedCluster"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of managed clusters. - :paramtype value: list[~azure.mgmt.containerservice.models.ManagedCluster] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class ManagedClusterLoadBalancerProfile(_serialization.Model): - """Profile of the managed cluster load balancer. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :vartype managed_outbound_i_ps: - ~azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :ivar outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load balancer. - :vartype outbound_ip_prefixes: - ~azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :ivar outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :vartype outbound_i_ps: - ~azure.mgmt.containerservice.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.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.models.BackendPoolType - :ivar cluster_service_load_balancer_health_probe_mode: The health probing behavior for External - Traffic Policy Cluster services. Known values are: "ServiceNodePort" and "Shared". - :vartype cluster_service_load_balancer_health_probe_mode: str or - ~azure.mgmt.containerservice.models.ClusterServiceLoadBalancerHealthProbeMode - """ - - _validation = { - "effective_outbound_i_ps": {"readonly": True}, - "allocated_outbound_ports": {"maximum": 64000, "minimum": 0}, - "idle_timeout_in_minutes": {"maximum": 120, "minimum": 4}, - } - - _attribute_map = { - "managed_outbound_i_ps": { - "key": "managedOutboundIPs", - "type": "ManagedClusterLoadBalancerProfileManagedOutboundIPs", - }, - "outbound_ip_prefixes": { - "key": "outboundIPPrefixes", - "type": "ManagedClusterLoadBalancerProfileOutboundIPPrefixes", - }, - "outbound_i_ps": {"key": "outboundIPs", "type": "ManagedClusterLoadBalancerProfileOutboundIPs"}, - "effective_outbound_i_ps": {"key": "effectiveOutboundIPs", "type": "[ResourceReference]"}, - "allocated_outbound_ports": {"key": "allocatedOutboundPorts", "type": "int"}, - "idle_timeout_in_minutes": {"key": "idleTimeoutInMinutes", "type": "int"}, - "enable_multiple_standard_load_balancers": {"key": "enableMultipleStandardLoadBalancers", "type": "bool"}, - "backend_pool_type": {"key": "backendPoolType", "type": "str"}, - "cluster_service_load_balancer_health_probe_mode": { - "key": "clusterServiceLoadBalancerHealthProbeMode", - "type": "str", - }, - } - - def __init__( - self, - *, - managed_outbound_i_ps: Optional["_models.ManagedClusterLoadBalancerProfileManagedOutboundIPs"] = None, - outbound_ip_prefixes: Optional["_models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes"] = None, - outbound_i_ps: Optional["_models.ManagedClusterLoadBalancerProfileOutboundIPs"] = None, - allocated_outbound_ports: int = 0, - idle_timeout_in_minutes: int = 30, - enable_multiple_standard_load_balancers: Optional[bool] = None, - backend_pool_type: Union[str, "_models.BackendPoolType"] = "NodeIPConfiguration", - cluster_service_load_balancer_health_probe_mode: Union[ - str, "_models.ClusterServiceLoadBalancerHealthProbeMode" - ] = "ServiceNodePort", - **kwargs: Any - ) -> None: - """ - :keyword managed_outbound_i_ps: Desired managed outbound IPs for the cluster load balancer. - :paramtype managed_outbound_i_ps: - ~azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileManagedOutboundIPs - :keyword outbound_ip_prefixes: Desired outbound IP Prefix resources for the cluster load - balancer. - :paramtype outbound_ip_prefixes: - ~azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileOutboundIPPrefixes - :keyword outbound_i_ps: Desired outbound IP resources for the cluster load balancer. - :paramtype outbound_i_ps: - ~azure.mgmt.containerservice.models.ManagedClusterLoadBalancerProfileOutboundIPs - :keyword allocated_outbound_ports: The desired number of allocated SNAT ports per VM. Allowed - values are in the range of 0 to 64000 (inclusive). The default value is 0 which results in - Azure dynamically allocating ports. - :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.models.BackendPoolType - :keyword cluster_service_load_balancer_health_probe_mode: The health probing behavior for - External Traffic Policy Cluster services. Known values are: "ServiceNodePort" and "Shared". - :paramtype cluster_service_load_balancer_health_probe_mode: str or - ~azure.mgmt.containerservice.models.ClusterServiceLoadBalancerHealthProbeMode - """ - super().__init__(**kwargs) - self.managed_outbound_i_ps = managed_outbound_i_ps - self.outbound_ip_prefixes = outbound_ip_prefixes - self.outbound_i_ps = outbound_i_ps - self.effective_outbound_i_ps: Optional[list["_models.ResourceReference"]] = None - self.allocated_outbound_ports = allocated_outbound_ports - self.idle_timeout_in_minutes = idle_timeout_in_minutes - self.enable_multiple_standard_load_balancers = enable_multiple_standard_load_balancers - self.backend_pool_type = backend_pool_type - self.cluster_service_load_balancer_health_probe_mode = cluster_service_load_balancer_health_probe_mode - - -class ManagedClusterLoadBalancerProfileManagedOutboundIPs(_serialization.Model): # pylint: disable=name-too-long - """Desired managed outbound IPs for the cluster load balancer. - - :ivar count: The desired number of IPv4 outbound IPs created/managed by Azure for the cluster - load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value - is 1. - :vartype count: int - :ivar count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the - cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default - value is 0 for single-stack and 1 for dual-stack. - :vartype count_ipv6: int - """ - - _validation = { - "count": {"maximum": 100, "minimum": 1}, - "count_ipv6": {"maximum": 100, "minimum": 0}, - } - - _attribute_map = { - "count": {"key": "count", "type": "int"}, - "count_ipv6": {"key": "countIPv6", "type": "int"}, - } - - def __init__(self, *, count: int = 1, count_ipv6: int = 0, **kwargs: Any) -> None: - """ - :keyword count: The desired number of IPv4 outbound IPs created/managed by Azure for the - cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default - value is 1. - :paramtype count: int - :keyword count_ipv6: The desired number of IPv6 outbound IPs created/managed by Azure for the - cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default - value is 0 for single-stack and 1 for dual-stack. - :paramtype count_ipv6: int - """ - super().__init__(**kwargs) - self.count = count - self.count_ipv6 = count_ipv6 - - -class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(_serialization.Model): # pylint: disable=name-too-long - """Desired outbound IP Prefix resources for the cluster load balancer. - - :ivar public_ip_prefixes: A list of public IP prefix resources. - :vartype public_ip_prefixes: list[~azure.mgmt.containerservice.models.ResourceReference] - """ - - _attribute_map = { - "public_ip_prefixes": {"key": "publicIPPrefixes", "type": "[ResourceReference]"}, - } - - def __init__( - self, *, public_ip_prefixes: Optional[list["_models.ResourceReference"]] = None, **kwargs: Any - ) -> None: - """ - :keyword public_ip_prefixes: A list of public IP prefix resources. - :paramtype public_ip_prefixes: list[~azure.mgmt.containerservice.models.ResourceReference] - """ - super().__init__(**kwargs) - self.public_ip_prefixes = public_ip_prefixes - - -class ManagedClusterLoadBalancerProfileOutboundIPs(_serialization.Model): # pylint: disable=name-too-long - """Desired outbound IP resources for the cluster load balancer. - - :ivar public_i_ps: A list of public IP resources. - :vartype public_i_ps: list[~azure.mgmt.containerservice.models.ResourceReference] - """ - - _attribute_map = { - "public_i_ps": {"key": "publicIPs", "type": "[ResourceReference]"}, - } - - def __init__(self, *, public_i_ps: Optional[list["_models.ResourceReference"]] = None, **kwargs: Any) -> None: - """ - :keyword public_i_ps: A list of public IP resources. - :paramtype public_i_ps: list[~azure.mgmt.containerservice.models.ResourceReference] - """ - super().__init__(**kwargs) - self.public_i_ps = public_i_ps - - -class ManagedClusterManagedOutboundIPProfile(_serialization.Model): - """Profile of the managed outbound IP resources of the managed cluster. - - :ivar count: The desired number of outbound IPs created/managed by Azure. Allowed values must - be in the range of 1 to 16 (inclusive). The default value is 1. - :vartype count: int - """ - - _validation = { - "count": {"maximum": 16, "minimum": 1}, - } - - _attribute_map = { - "count": {"key": "count", "type": "int"}, - } - - def __init__(self, *, count: int = 1, **kwargs: Any) -> None: - """ - :keyword count: The desired number of outbound IPs created/managed by Azure. Allowed values - must be in the range of 1 to 16 (inclusive). The default value is 1. - :paramtype count: int - """ - super().__init__(**kwargs) - self.count = count - - -class ManagedClusterMetricsProfile(_serialization.Model): - """The metrics profile for the ManagedCluster. - - :ivar cost_analysis: The configuration for detailed per-Kubernetes resource cost analysis. - :vartype cost_analysis: ~azure.mgmt.containerservice.models.ManagedClusterCostAnalysis - """ - - _attribute_map = { - "cost_analysis": {"key": "costAnalysis", "type": "ManagedClusterCostAnalysis"}, - } - - def __init__(self, *, cost_analysis: Optional["_models.ManagedClusterCostAnalysis"] = None, **kwargs: Any) -> None: - """ - :keyword cost_analysis: The configuration for detailed per-Kubernetes resource cost analysis. - :paramtype cost_analysis: ~azure.mgmt.containerservice.models.ManagedClusterCostAnalysis - """ - super().__init__(**kwargs) - self.cost_analysis = cost_analysis - - -class ManagedClusterNATGatewayProfile(_serialization.Model): - """Profile of the managed cluster NAT gateway. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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.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.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 = { - "effective_outbound_i_ps": {"readonly": True}, - "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, - idle_timeout_in_minutes: int = 4, - **kwargs: Any - ) -> None: - """ - :keyword managed_outbound_ip_profile: Profile of the managed outbound IP resources of the - cluster NAT gateway. - :paramtype managed_outbound_ip_profile: - ~azure.mgmt.containerservice.models.ManagedClusterManagedOutboundIPProfile - :keyword idle_timeout_in_minutes: Desired outbound flow idle timeout in minutes. Allowed values - are in the range of 4 to 120 (inclusive). The default value is 4 minutes. - :paramtype idle_timeout_in_minutes: int - """ - super().__init__(**kwargs) - self.managed_outbound_ip_profile = managed_outbound_ip_profile - self.effective_outbound_i_ps: Optional[list["_models.ResourceReference"]] = None - self.idle_timeout_in_minutes = idle_timeout_in_minutes - - -class ManagedClusterNodeProvisioningProfile(_serialization.Model): - """ManagedClusterNodeProvisioningProfile. - - :ivar mode: The node provisioning mode. If not specified, the default is Manual. Known values - are: "Manual" and "Auto". - :vartype mode: str or ~azure.mgmt.containerservice.models.NodeProvisioningMode - :ivar default_node_pools: The set of default Karpenter NodePools (CRDs) configured for node - provisioning. This field has no effect unless mode is 'Auto'. Warning: Changing this from Auto - to None on an existing cluster will cause the default Karpenter NodePools to be deleted, which - will drain and delete the nodes associated with those pools. It is strongly recommended to not - do this unless there are idle nodes ready to take the pods evicted by that action. If not - specified, the default is Auto. For more information see aka.ms/aks/nap#node-pools. Known - values are: "None" and "Auto". - :vartype default_node_pools: str or - ~azure.mgmt.containerservice.models.NodeProvisioningDefaultNodePools - """ - - _attribute_map = { - "mode": {"key": "mode", "type": "str"}, - "default_node_pools": {"key": "defaultNodePools", "type": "str"}, - } - - def __init__( - self, - *, - mode: Optional[Union[str, "_models.NodeProvisioningMode"]] = None, - default_node_pools: Union[str, "_models.NodeProvisioningDefaultNodePools"] = "Auto", - **kwargs: Any - ) -> None: - """ - :keyword mode: The node provisioning mode. If not specified, the default is Manual. Known - values are: "Manual" and "Auto". - :paramtype mode: str or ~azure.mgmt.containerservice.models.NodeProvisioningMode - :keyword default_node_pools: The set of default Karpenter NodePools (CRDs) configured for node - provisioning. This field has no effect unless mode is 'Auto'. Warning: Changing this from Auto - to None on an existing cluster will cause the default Karpenter NodePools to be deleted, which - will drain and delete the nodes associated with those pools. It is strongly recommended to not - do this unless there are idle nodes ready to take the pods evicted by that action. If not - specified, the default is Auto. For more information see aka.ms/aks/nap#node-pools. Known - values are: "None" and "Auto". - :paramtype default_node_pools: str or - ~azure.mgmt.containerservice.models.NodeProvisioningDefaultNodePools - """ - super().__init__(**kwargs) - self.mode = mode - self.default_node_pools = default_node_pools - - -class ManagedClusterNodeResourceGroupProfile(_serialization.Model): - """Node resource group lockdown profile for a managed cluster. - - :ivar restriction_level: The restriction level applied to the cluster's node resource group. - Known values are: "Unrestricted" and "ReadOnly". - :vartype restriction_level: str or ~azure.mgmt.containerservice.models.RestrictionLevel - """ - - _attribute_map = { - "restriction_level": {"key": "restrictionLevel", "type": "str"}, - } - - def __init__( - self, *, restriction_level: Optional[Union[str, "_models.RestrictionLevel"]] = None, **kwargs: Any - ) -> None: - """ - :keyword restriction_level: The restriction level applied to the cluster's node resource group. - Known values are: "Unrestricted" and "ReadOnly". - :paramtype restriction_level: str or ~azure.mgmt.containerservice.models.RestrictionLevel - """ - super().__init__(**kwargs) - self.restriction_level = restriction_level - - -class ManagedClusterOIDCIssuerProfile(_serialization.Model): - """The OIDC issuer profile of the Managed Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar issuer_url: The OIDC issuer url of the Managed Cluster. - :vartype issuer_url: str - :ivar enabled: Whether the OIDC issuer is enabled. - :vartype enabled: bool - """ - - _validation = { - "issuer_url": {"readonly": True}, - } - - _attribute_map = { - "issuer_url": {"key": "issuerURL", "type": "str"}, - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether the OIDC issuer is enabled. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.issuer_url: Optional[str] = None - self.enabled = enabled - - -class ManagedClusterPodIdentity(_serialization.Model): - """Details about the pod identity assigned to the Managed Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar name: The name of the pod identity. Required. - :vartype name: str - :ivar namespace: The namespace of the pod identity. Required. - :vartype namespace: str - :ivar binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :vartype binding_selector: str - :ivar identity: The user assigned identity details. Required. - :vartype identity: ~azure.mgmt.containerservice.models.UserAssignedIdentity - :ivar provisioning_state: The current provisioning state of the pod identity. Known values are: - "Assigned", "Canceled", "Deleting", "Failed", "Succeeded", and "Updating". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningState - :ivar provisioning_info: - :vartype provisioning_info: - ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningInfo - """ - - _validation = { - "name": {"required": True}, - "namespace": {"required": True}, - "identity": {"required": True}, - "provisioning_state": {"readonly": True}, - "provisioning_info": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "namespace": {"key": "namespace", "type": "str"}, - "binding_selector": {"key": "bindingSelector", "type": "str"}, - "identity": {"key": "identity", "type": "UserAssignedIdentity"}, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "provisioning_info": {"key": "provisioningInfo", "type": "ManagedClusterPodIdentityProvisioningInfo"}, - } - - def __init__( - self, - *, - name: str, - namespace: str, - identity: "_models.UserAssignedIdentity", - binding_selector: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The name of the pod identity. Required. - :paramtype name: str - :keyword namespace: The namespace of the pod identity. Required. - :paramtype namespace: str - :keyword binding_selector: The binding selector to use for the AzureIdentityBinding resource. - :paramtype binding_selector: str - :keyword identity: The user assigned identity details. Required. - :paramtype identity: ~azure.mgmt.containerservice.models.UserAssignedIdentity - """ - super().__init__(**kwargs) - self.name = name - self.namespace = namespace - self.binding_selector = binding_selector - self.identity = identity - self.provisioning_state: Optional[Union[str, "_models.ManagedClusterPodIdentityProvisioningState"]] = None - self.provisioning_info: Optional["_models.ManagedClusterPodIdentityProvisioningInfo"] = None - - -class ManagedClusterPodIdentityException(_serialization.Model): - """A pod identity exception, which allows pods with certain labels to access the Azure Instance - Metadata Service (IMDS) endpoint without being intercepted by the node-managed identity (NMI) - server. See `disable AAD Pod Identity for a specific Pod/Application - `_ for more - details. - - All required parameters must be populated in order to send to server. - - :ivar name: The name of the pod identity exception. Required. - :vartype name: str - :ivar namespace: The namespace of the pod identity exception. Required. - :vartype namespace: str - :ivar pod_labels: The pod labels to match. Required. - :vartype pod_labels: dict[str, str] - """ - - _validation = { - "name": {"required": True}, - "namespace": {"required": True}, - "pod_labels": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "namespace": {"key": "namespace", "type": "str"}, - "pod_labels": {"key": "podLabels", "type": "{str}"}, - } - - def __init__(self, *, name: str, namespace: str, pod_labels: dict[str, str], **kwargs: Any) -> None: - """ - :keyword name: The name of the pod identity exception. Required. - :paramtype name: str - :keyword namespace: The namespace of the pod identity exception. Required. - :paramtype namespace: str - :keyword pod_labels: The pod labels to match. Required. - :paramtype pod_labels: dict[str, str] - """ - super().__init__(**kwargs) - self.name = name - self.namespace = namespace - self.pod_labels = pod_labels - - -class ManagedClusterPodIdentityProfile(_serialization.Model): - """The pod identity profile of the Managed Cluster. 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: Whether pod identity is allowed to run on clusters with - Kubenet networking. 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.models.ManagedClusterPodIdentity] - :ivar user_assigned_identity_exceptions: The pod identity exceptions to allow. - :vartype user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.models.ManagedClusterPodIdentityException] - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "allow_network_plugin_kubenet": {"key": "allowNetworkPluginKubenet", "type": "bool"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "[ManagedClusterPodIdentity]"}, - "user_assigned_identity_exceptions": { - "key": "userAssignedIdentityExceptions", - "type": "[ManagedClusterPodIdentityException]", - }, - } - - def __init__( - self, - *, - enabled: Optional[bool] = None, - allow_network_plugin_kubenet: Optional[bool] = None, - user_assigned_identities: Optional[list["_models.ManagedClusterPodIdentity"]] = None, - user_assigned_identity_exceptions: Optional[list["_models.ManagedClusterPodIdentityException"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Whether the pod identity addon is enabled. - :paramtype enabled: bool - :keyword allow_network_plugin_kubenet: Whether pod identity is allowed to run on clusters with - Kubenet networking. 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.models.ManagedClusterPodIdentity] - :keyword user_assigned_identity_exceptions: The pod identity exceptions to allow. - :paramtype user_assigned_identity_exceptions: - list[~azure.mgmt.containerservice.models.ManagedClusterPodIdentityException] - """ - super().__init__(**kwargs) - self.enabled = enabled - self.allow_network_plugin_kubenet = allow_network_plugin_kubenet - self.user_assigned_identities = user_assigned_identities - self.user_assigned_identity_exceptions = user_assigned_identity_exceptions - - -class ManagedClusterPodIdentityProvisioningError(_serialization.Model): # pylint: disable=name-too-long - """An error response from the pod identity provisioning. - - :ivar error: Details about the error. - :vartype error: - ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningErrorBody - """ - - _attribute_map = { - "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningErrorBody"}, - } - - def __init__( - self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningErrorBody"] = None, **kwargs: Any - ) -> None: - """ - :keyword error: Details about the error. - :paramtype error: - ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningErrorBody - """ - super().__init__(**kwargs) - self.error = error - - -class ManagedClusterPodIdentityProvisioningErrorBody(_serialization.Model): # pylint: disable=name-too-long - """An error response from the pod identity provisioning. - - :ivar code: An identifier for the error. Codes are invariant and are intended to be consumed - programmatically. - :vartype code: str - :ivar message: A message describing the error, intended to be suitable for display in a user - interface. - :vartype message: str - :ivar target: The target of the particular error. For example, the name of the property in - error. - :vartype target: str - :ivar details: A list of additional details about the error. - :vartype details: - list[~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningErrorBody] - """ - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ManagedClusterPodIdentityProvisioningErrorBody]"}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, - target: Optional[str] = None, - details: Optional[list["_models.ManagedClusterPodIdentityProvisioningErrorBody"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword code: An identifier for the error. Codes are invariant and are intended to be consumed - programmatically. - :paramtype code: str - :keyword message: A message describing the error, intended to be suitable for display in a user - interface. - :paramtype message: str - :keyword target: The target of the particular error. For example, the name of the property in - error. - :paramtype target: str - :keyword details: A list of additional details about the error. - :paramtype details: - list[~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningErrorBody] - """ - super().__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - - -class ManagedClusterPodIdentityProvisioningInfo(_serialization.Model): # pylint: disable=name-too-long - """ManagedClusterPodIdentityProvisioningInfo. - - :ivar error: Pod identity assignment error (if any). - :vartype error: ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningError - """ - - _attribute_map = { - "error": {"key": "error", "type": "ManagedClusterPodIdentityProvisioningError"}, - } - - def __init__( - self, *, error: Optional["_models.ManagedClusterPodIdentityProvisioningError"] = None, **kwargs: Any - ) -> None: - """ - :keyword error: Pod identity assignment error (if any). - :paramtype error: - ~azure.mgmt.containerservice.models.ManagedClusterPodIdentityProvisioningError - """ - super().__init__(**kwargs) - self.error = error - - -class ManagedClusterPoolUpgradeProfile(_serialization.Model): - """The list of available upgrade versions. - - All required parameters must be populated in order to send to server. - - :ivar kubernetes_version: The Kubernetes version (major.minor.patch). Required. - :vartype kubernetes_version: str - :ivar name: The Agent Pool name. - :vartype name: str - :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and - "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType - :ivar upgrades: List of orchestrator types and versions available for upgrade. - :vartype upgrades: - list[~azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - :ivar components_by_releases: List of components grouped by kubernetes major.minor version. - :vartype components_by_releases: list[~azure.mgmt.containerservice.models.ComponentsByRelease] - """ - - _validation = { - "kubernetes_version": {"required": True}, - "os_type": {"required": True}, - } - - _attribute_map = { - "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "os_type": {"key": "osType", "type": "str"}, - "upgrades": {"key": "upgrades", "type": "[ManagedClusterPoolUpgradeProfileUpgradesItem]"}, - "components_by_releases": {"key": "componentsByReleases", "type": "[ComponentsByRelease]"}, - } - - def __init__( - self, - *, - kubernetes_version: str, - os_type: Union[str, "_models.OSType"] = "Linux", - name: Optional[str] = None, - upgrades: Optional[list["_models.ManagedClusterPoolUpgradeProfileUpgradesItem"]] = None, - components_by_releases: Optional[list["_models.ComponentsByRelease"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword kubernetes_version: The Kubernetes version (major.minor.patch). Required. - :paramtype kubernetes_version: str - :keyword name: The Agent Pool name. - :paramtype name: str - :keyword os_type: The operating system type. The default is Linux. Known values are: "Linux" - and "Windows". - :paramtype os_type: str or ~azure.mgmt.containerservice.models.OSType - :keyword upgrades: List of orchestrator types and versions available for upgrade. - :paramtype upgrades: - list[~azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfileUpgradesItem] - :keyword components_by_releases: List of components grouped by kubernetes major.minor version. - :paramtype components_by_releases: - list[~azure.mgmt.containerservice.models.ComponentsByRelease] - """ - super().__init__(**kwargs) - self.kubernetes_version = kubernetes_version - self.name = name - self.os_type = os_type - self.upgrades = upgrades - self.components_by_releases = components_by_releases - - -class ManagedClusterPoolUpgradeProfileUpgradesItem(_serialization.Model): # pylint: disable=name-too-long - """ManagedClusterPoolUpgradeProfileUpgradesItem. - - :ivar kubernetes_version: The Kubernetes version (major.minor.patch). - :vartype kubernetes_version: str - :ivar is_preview: Whether the Kubernetes version is currently in preview. - :vartype is_preview: bool - :ivar is_out_of_support: Whether the Kubernetes version is out of support. - :vartype is_out_of_support: bool - """ - - _attribute_map = { - "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, - "is_preview": {"key": "isPreview", "type": "bool"}, - "is_out_of_support": {"key": "isOutOfSupport", "type": "bool"}, - } - - def __init__( - self, - *, - kubernetes_version: Optional[str] = None, - is_preview: Optional[bool] = None, - is_out_of_support: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword kubernetes_version: The Kubernetes version (major.minor.patch). - :paramtype kubernetes_version: str - :keyword is_preview: Whether the Kubernetes version is currently in preview. - :paramtype is_preview: bool - :keyword is_out_of_support: Whether the Kubernetes version is out of support. - :paramtype is_out_of_support: bool - """ - super().__init__(**kwargs) - self.kubernetes_version = kubernetes_version - self.is_preview = is_preview - self.is_out_of_support = is_out_of_support - - -class ManagedClusterPropertiesAutoScalerProfile(_serialization.Model): # pylint: disable=name-too-long - """Parameters to be applied to the cluster-autoscaler when enabled. - - :ivar balance_similar_node_groups: Detects similar node pools and balances the number of nodes - between them. Valid values are 'true' and 'false'. - :vartype balance_similar_node_groups: str - :ivar daemonset_eviction_for_empty_nodes: DaemonSet pods will be gracefully terminated from - empty nodes. If set to true, all daemonset pods on empty nodes will be evicted before deletion - of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If - set to false, the node will be deleted without ensuring that daemonset pods are deleted or - evicted. - :vartype daemonset_eviction_for_empty_nodes: bool - :ivar daemonset_eviction_for_occupied_nodes: DaemonSet pods will be gracefully terminated from - non-empty nodes. If set to true, all daemonset pods on occupied nodes will be evicted before - deletion of the node. If the daemonset pod cannot be evicted another node will be chosen for - scaling. If set to false, the node will be deleted without ensuring that daemonset pods are - deleted or evicted. - :vartype daemonset_eviction_for_occupied_nodes: bool - :ivar ignore_daemonsets_utilization: Should CA ignore DaemonSet pods when calculating resource - utilization for scaling down. If set to true, the resources used by daemonset will be taken - into account when making scaling down decisions. - :vartype ignore_daemonsets_utilization: bool - :ivar expander: Type of node group expander to be used in scale up. Set to be deprecated, - please use 'expanders' flag in the future. Available values are: 'least-waste', 'most-pods', - 'priority', 'random'. Known values are: "least-waste", "most-pods", "priority", and "random". - :vartype expander: str or ~azure.mgmt.containerservice.models.Expander - :ivar max_empty_bulk_delete: The maximum number of empty nodes that can be deleted at the same - time. This must be a positive integer. The default is 10. - :vartype max_empty_bulk_delete: str - :ivar max_graceful_termination_sec: The maximum number of seconds the cluster autoscaler waits - for pod termination when trying to scale down a node. The default is 600. - :vartype max_graceful_termination_sec: str - :ivar max_node_provision_time: The maximum time the autoscaler waits for a node to be - provisioned. 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 maximum percentage of unready nodes in the cluster. - After this percentage is exceeded, cluster autoscaler halts operations. 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: Ignore unscheduled pods before they're a certain age. 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: The number of allowed unready nodes, irrespective of - max-total-unready-percentage. This must be an integer. The default is 3. - :vartype ok_total_unready_count: str - :ivar scan_interval: How often cluster is reevaluated for scale up or down. The default is - '10'. Values must be an integer number of seconds. - :vartype scan_interval: str - :ivar scale_down_delay_after_add: How long after scale up that scale down evaluation resumes. - 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: How long after node deletion that scale down evaluation - resumes. 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: How long after scale down failure that scale down - evaluation resumes. 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: How long a node should be unneeded before it is eligible for - scale down. 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: How long an unready node should be unneeded before it is - eligible for scale down. 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: Node utilization level, defined as sum of requested - resources divided by capacity, below which a node can be considered for scale down. The default - is '0.5'. - :vartype scale_down_utilization_threshold: str - :ivar skip_nodes_with_local_storage: If cluster autoscaler will skip deleting nodes with pods - with local storage, for example, EmptyDir or HostPath. The default is true. - :vartype skip_nodes_with_local_storage: str - :ivar skip_nodes_with_system_pods: If cluster autoscaler will skip deleting nodes with pods - from kube-system (except for DaemonSet or mirror pods). The default is true. - :vartype skip_nodes_with_system_pods: str - """ - - _attribute_map = { - "balance_similar_node_groups": {"key": "balance-similar-node-groups", "type": "str"}, - "daemonset_eviction_for_empty_nodes": {"key": "daemonset-eviction-for-empty-nodes", "type": "bool"}, - "daemonset_eviction_for_occupied_nodes": {"key": "daemonset-eviction-for-occupied-nodes", "type": "bool"}, - "ignore_daemonsets_utilization": {"key": "ignore-daemonsets-utilization", "type": "bool"}, - "expander": {"key": "expander", "type": "str"}, - "max_empty_bulk_delete": {"key": "max-empty-bulk-delete", "type": "str"}, - "max_graceful_termination_sec": {"key": "max-graceful-termination-sec", "type": "str"}, - "max_node_provision_time": {"key": "max-node-provision-time", "type": "str"}, - "max_total_unready_percentage": {"key": "max-total-unready-percentage", "type": "str"}, - "new_pod_scale_up_delay": {"key": "new-pod-scale-up-delay", "type": "str"}, - "ok_total_unready_count": {"key": "ok-total-unready-count", "type": "str"}, - "scan_interval": {"key": "scan-interval", "type": "str"}, - "scale_down_delay_after_add": {"key": "scale-down-delay-after-add", "type": "str"}, - "scale_down_delay_after_delete": {"key": "scale-down-delay-after-delete", "type": "str"}, - "scale_down_delay_after_failure": {"key": "scale-down-delay-after-failure", "type": "str"}, - "scale_down_unneeded_time": {"key": "scale-down-unneeded-time", "type": "str"}, - "scale_down_unready_time": {"key": "scale-down-unready-time", "type": "str"}, - "scale_down_utilization_threshold": {"key": "scale-down-utilization-threshold", "type": "str"}, - "skip_nodes_with_local_storage": {"key": "skip-nodes-with-local-storage", "type": "str"}, - "skip_nodes_with_system_pods": {"key": "skip-nodes-with-system-pods", "type": "str"}, - } - - def __init__( - self, - *, - balance_similar_node_groups: Optional[str] = None, - daemonset_eviction_for_empty_nodes: Optional[bool] = None, - daemonset_eviction_for_occupied_nodes: Optional[bool] = None, - ignore_daemonsets_utilization: Optional[bool] = None, - expander: Optional[Union[str, "_models.Expander"]] = None, - max_empty_bulk_delete: Optional[str] = None, - max_graceful_termination_sec: Optional[str] = None, - max_node_provision_time: Optional[str] = None, - max_total_unready_percentage: Optional[str] = None, - new_pod_scale_up_delay: Optional[str] = None, - ok_total_unready_count: Optional[str] = None, - scan_interval: Optional[str] = None, - scale_down_delay_after_add: Optional[str] = None, - scale_down_delay_after_delete: Optional[str] = None, - scale_down_delay_after_failure: Optional[str] = None, - scale_down_unneeded_time: Optional[str] = None, - scale_down_unready_time: Optional[str] = None, - scale_down_utilization_threshold: Optional[str] = None, - skip_nodes_with_local_storage: Optional[str] = None, - skip_nodes_with_system_pods: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword balance_similar_node_groups: Detects similar node pools and balances the number of - nodes between them. Valid values are 'true' and 'false'. - :paramtype balance_similar_node_groups: str - :keyword daemonset_eviction_for_empty_nodes: DaemonSet pods will be gracefully terminated from - empty nodes. If set to true, all daemonset pods on empty nodes will be evicted before deletion - of the node. If the daemonset pod cannot be evicted another node will be chosen for scaling. If - set to false, the node will be deleted without ensuring that daemonset pods are deleted or - evicted. - :paramtype daemonset_eviction_for_empty_nodes: bool - :keyword daemonset_eviction_for_occupied_nodes: DaemonSet pods will be gracefully terminated - from non-empty nodes. If set to true, all daemonset pods on occupied nodes will be evicted - before deletion of the node. If the daemonset pod cannot be evicted another node will be chosen - for scaling. If set to false, the node will be deleted without ensuring that daemonset pods are - deleted or evicted. - :paramtype daemonset_eviction_for_occupied_nodes: bool - :keyword ignore_daemonsets_utilization: Should CA ignore DaemonSet pods when calculating - resource utilization for scaling down. If set to true, the resources used by daemonset will be - taken into account when making scaling down decisions. - :paramtype ignore_daemonsets_utilization: bool - :keyword expander: Type of node group expander to be used in scale up. Set to be deprecated, - please use 'expanders' flag in the future. Available values are: 'least-waste', 'most-pods', - 'priority', 'random'. Known values are: "least-waste", "most-pods", "priority", and "random". - :paramtype expander: str or ~azure.mgmt.containerservice.models.Expander - :keyword max_empty_bulk_delete: The maximum number of empty nodes that can be deleted at the - same time. This must be a positive integer. The default is 10. - :paramtype max_empty_bulk_delete: str - :keyword max_graceful_termination_sec: The maximum number of seconds the cluster autoscaler - waits for pod termination when trying to scale down a node. The default is 600. - :paramtype max_graceful_termination_sec: str - :keyword max_node_provision_time: The maximum time the autoscaler waits for a node to be - provisioned. 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 maximum percentage of unready nodes in the cluster. - After this percentage is exceeded, cluster autoscaler halts operations. 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: Ignore unscheduled pods before they're a certain age. 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: The number of allowed unready nodes, irrespective of - max-total-unready-percentage. This must be an integer. The default is 3. - :paramtype ok_total_unready_count: str - :keyword scan_interval: How often cluster is reevaluated for scale up or down. The default is - '10'. Values must be an integer number of seconds. - :paramtype scan_interval: str - :keyword scale_down_delay_after_add: How long after scale up that scale down evaluation - resumes. 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: How long after node deletion that scale down evaluation - resumes. 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: How long after scale down failure that scale down - evaluation resumes. 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: How long a node should be unneeded before it is eligible for - scale down. 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: How long an unready node should be unneeded before it is - eligible for scale down. 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: Node utilization level, defined as sum of requested - resources divided by capacity, below which a node can be considered for scale down. The default - is '0.5'. - :paramtype scale_down_utilization_threshold: str - :keyword skip_nodes_with_local_storage: If cluster autoscaler will skip deleting nodes with - pods with local storage, for example, EmptyDir or HostPath. The default is true. - :paramtype skip_nodes_with_local_storage: str - :keyword skip_nodes_with_system_pods: If cluster autoscaler will skip deleting nodes with pods - from kube-system (except for DaemonSet or mirror pods). The default is true. - :paramtype skip_nodes_with_system_pods: str - """ - super().__init__(**kwargs) - self.balance_similar_node_groups = balance_similar_node_groups - self.daemonset_eviction_for_empty_nodes = daemonset_eviction_for_empty_nodes - self.daemonset_eviction_for_occupied_nodes = daemonset_eviction_for_occupied_nodes - self.ignore_daemonsets_utilization = ignore_daemonsets_utilization - self.expander = expander - self.max_empty_bulk_delete = max_empty_bulk_delete - self.max_graceful_termination_sec = max_graceful_termination_sec - self.max_node_provision_time = max_node_provision_time - self.max_total_unready_percentage = max_total_unready_percentage - self.new_pod_scale_up_delay = new_pod_scale_up_delay - self.ok_total_unready_count = ok_total_unready_count - self.scan_interval = scan_interval - self.scale_down_delay_after_add = scale_down_delay_after_add - self.scale_down_delay_after_delete = scale_down_delay_after_delete - self.scale_down_delay_after_failure = scale_down_delay_after_failure - self.scale_down_unneeded_time = scale_down_unneeded_time - self.scale_down_unready_time = scale_down_unready_time - self.scale_down_utilization_threshold = scale_down_utilization_threshold - self.skip_nodes_with_local_storage = skip_nodes_with_local_storage - self.skip_nodes_with_system_pods = skip_nodes_with_system_pods - - -class ManagedClusterPropertiesForSnapshot(_serialization.Model): - """managed cluster properties for snapshot, these properties are read only. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kubernetes_version: The current kubernetes version. - :vartype kubernetes_version: str - :ivar sku: The current managed cluster sku. - :vartype sku: ~azure.mgmt.containerservice.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.models.NetworkProfileForSnapshot - """ - - _validation = { - "network_profile": {"readonly": True}, - } - - _attribute_map = { - "kubernetes_version": {"key": "kubernetesVersion", "type": "str"}, - "sku": {"key": "sku", "type": "ManagedClusterSKU"}, - "enable_rbac": {"key": "enableRbac", "type": "bool"}, - "network_profile": {"key": "networkProfile", "type": "NetworkProfileForSnapshot"}, - } - - def __init__( - self, - *, - kubernetes_version: Optional[str] = None, - sku: Optional["_models.ManagedClusterSKU"] = None, - enable_rbac: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword kubernetes_version: The current kubernetes version. - :paramtype kubernetes_version: str - :keyword sku: The current managed cluster sku. - :paramtype sku: ~azure.mgmt.containerservice.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: Optional["_models.NetworkProfileForSnapshot"] = 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.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.models.AzureKeyVaultKms - :ivar kubernetes_resource_object_encryption_profile: Encryption at rest of Kubernetes resource - objects. More information on this can be found under - https://aka.ms/aks/kubernetesResourceObjectEncryption. - :vartype kubernetes_resource_object_encryption_profile: - ~azure.mgmt.containerservice.models.KubernetesResourceObjectEncryptionProfile - :ivar workload_identity: Workload identity settings for the security profile. Workload identity - enables Kubernetes applications to access Azure cloud resources securely with Azure AD. See - https://aka.ms/aks/wi for more details. - :vartype workload_identity: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileWorkloadIdentity - :ivar image_cleaner: Image Cleaner settings for the security profile. - :vartype image_cleaner: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileImageCleaner - :ivar image_integrity: Image integrity is a feature that works with Azure Policy to verify - image integrity by signature. This will not have any effect unless Azure Policy is applied to - enforce image signatures. See https://aka.ms/aks/image-integrity for how to use this feature - via policy. - :vartype image_integrity: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileImageIntegrity - :ivar node_restriction: `Node Restriction - `_ - settings for the security profile. - :vartype node_restriction: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileNodeRestriction - :ivar custom_ca_trust_certificates: A list of up to 10 base64 encoded CAs that will be added to - the trust store on all nodes in the cluster. For more information see `Custom CA Trust - Certificates `_. - :vartype custom_ca_trust_certificates: list[bytes] - """ - - _validation = { - "custom_ca_trust_certificates": {"max_items": 10, "min_items": 0}, - } - - _attribute_map = { - "defender": {"key": "defender", "type": "ManagedClusterSecurityProfileDefender"}, - "azure_key_vault_kms": {"key": "azureKeyVaultKms", "type": "AzureKeyVaultKms"}, - "kubernetes_resource_object_encryption_profile": { - "key": "kubernetesResourceObjectEncryptionProfile", - "type": "KubernetesResourceObjectEncryptionProfile", - }, - "workload_identity": {"key": "workloadIdentity", "type": "ManagedClusterSecurityProfileWorkloadIdentity"}, - "image_cleaner": {"key": "imageCleaner", "type": "ManagedClusterSecurityProfileImageCleaner"}, - "image_integrity": {"key": "imageIntegrity", "type": "ManagedClusterSecurityProfileImageIntegrity"}, - "node_restriction": {"key": "nodeRestriction", "type": "ManagedClusterSecurityProfileNodeRestriction"}, - "custom_ca_trust_certificates": {"key": "customCATrustCertificates", "type": "[bytearray]"}, - } - - def __init__( - self, - *, - defender: Optional["_models.ManagedClusterSecurityProfileDefender"] = None, - azure_key_vault_kms: Optional["_models.AzureKeyVaultKms"] = None, - kubernetes_resource_object_encryption_profile: Optional[ - "_models.KubernetesResourceObjectEncryptionProfile" - ] = None, - workload_identity: Optional["_models.ManagedClusterSecurityProfileWorkloadIdentity"] = None, - image_cleaner: Optional["_models.ManagedClusterSecurityProfileImageCleaner"] = None, - image_integrity: Optional["_models.ManagedClusterSecurityProfileImageIntegrity"] = None, - node_restriction: Optional["_models.ManagedClusterSecurityProfileNodeRestriction"] = None, - custom_ca_trust_certificates: Optional[list[bytes]] = None, - **kwargs: Any - ) -> None: - """ - :keyword defender: Microsoft Defender settings for the security profile. - :paramtype defender: ~azure.mgmt.containerservice.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.models.AzureKeyVaultKms - :keyword kubernetes_resource_object_encryption_profile: Encryption at rest of Kubernetes - resource objects. More information on this can be found under - https://aka.ms/aks/kubernetesResourceObjectEncryption. - :paramtype kubernetes_resource_object_encryption_profile: - ~azure.mgmt.containerservice.models.KubernetesResourceObjectEncryptionProfile - :keyword workload_identity: Workload identity settings for the security profile. Workload - identity enables Kubernetes applications to access Azure cloud resources securely with Azure - AD. See https://aka.ms/aks/wi for more details. - :paramtype workload_identity: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileWorkloadIdentity - :keyword image_cleaner: Image Cleaner settings for the security profile. - :paramtype image_cleaner: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileImageCleaner - :keyword image_integrity: Image integrity is a feature that works with Azure Policy to verify - image integrity by signature. This will not have any effect unless Azure Policy is applied to - enforce image signatures. See https://aka.ms/aks/image-integrity for how to use this feature - via policy. - :paramtype image_integrity: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileImageIntegrity - :keyword node_restriction: `Node Restriction - `_ - settings for the security profile. - :paramtype node_restriction: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileNodeRestriction - :keyword custom_ca_trust_certificates: A list of up to 10 base64 encoded CAs that will be added - to the trust store on all nodes in the cluster. For more information see `Custom CA Trust - Certificates `_. - :paramtype custom_ca_trust_certificates: list[bytes] - """ - super().__init__(**kwargs) - self.defender = defender - self.azure_key_vault_kms = azure_key_vault_kms - self.kubernetes_resource_object_encryption_profile = kubernetes_resource_object_encryption_profile - self.workload_identity = workload_identity - self.image_cleaner = image_cleaner - self.image_integrity = image_integrity - self.node_restriction = node_restriction - self.custom_ca_trust_certificates = custom_ca_trust_certificates - - -class ManagedClusterSecurityProfileDefender(_serialization.Model): - """Microsoft Defender settings for the security profile. - - :ivar log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be - associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required - and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field - empty. - :vartype log_analytics_workspace_resource_id: str - :ivar security_monitoring: Microsoft Defender threat detection for Cloud settings for the - security profile. - :vartype security_monitoring: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring - :ivar security_gating: Microsoft Defender settings for security gating, validates container - images eligibility for deployment based on Defender for Containers security findings. Using - Admission Controller, it either audits or prevents the deployment of images that do not meet - security standards. - :vartype security_gating: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityGating - """ - - _attribute_map = { - "log_analytics_workspace_resource_id": {"key": "logAnalyticsWorkspaceResourceId", "type": "str"}, - "security_monitoring": { - "key": "securityMonitoring", - "type": "ManagedClusterSecurityProfileDefenderSecurityMonitoring", - }, - "security_gating": {"key": "securityGating", "type": "ManagedClusterSecurityProfileDefenderSecurityGating"}, - } - - def __init__( - self, - *, - log_analytics_workspace_resource_id: Optional[str] = None, - security_monitoring: Optional["_models.ManagedClusterSecurityProfileDefenderSecurityMonitoring"] = None, - security_gating: Optional["_models.ManagedClusterSecurityProfileDefenderSecurityGating"] = None, - **kwargs: Any - ) -> None: - """ - :keyword log_analytics_workspace_resource_id: Resource ID of the Log Analytics workspace to be - associated with Microsoft Defender. When Microsoft Defender is enabled, this field is required - and must be a valid workspace resource ID. When Microsoft Defender is disabled, leave the field - empty. - :paramtype log_analytics_workspace_resource_id: str - :keyword security_monitoring: Microsoft Defender threat detection for Cloud settings for the - security profile. - :paramtype security_monitoring: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityMonitoring - :keyword security_gating: Microsoft Defender settings for security gating, validates container - images eligibility for deployment based on Defender for Containers security findings. Using - Admission Controller, it either audits or prevents the deployment of images that do not meet - security standards. - :paramtype security_gating: - ~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityGating - """ - super().__init__(**kwargs) - self.log_analytics_workspace_resource_id = log_analytics_workspace_resource_id - self.security_monitoring = security_monitoring - self.security_gating = security_gating - - -class ManagedClusterSecurityProfileDefenderSecurityGating(_serialization.Model): # pylint: disable=name-too-long - """Microsoft Defender settings for security gating, validates container images eligibility for - deployment based on Defender for Containers security findings. Using Admission Controller, it - either audits or prevents the deployment of images that do not meet security standards. - - :ivar enabled: Whether to enable Defender security gating. When enabled, the gating feature - will scan container images and audit or block the deployment of images that do not meet - security standards according to the configured security rules. - :vartype enabled: bool - :ivar identities: List of identities that the admission controller will make use of in order to - pull security artifacts from the registry. These are the same identities used by the cluster to - pull container images. Each identity provided should have federated identity credential - attached to it. - :vartype identities: - list[~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem] - :ivar allow_secret_access: In use only while registry access granted by secret rather than - managed identity. Set whether to grant the Defender gating agent access to the cluster's - secrets for pulling images from registries. If secret access is denied and the registry - requires pull secrets, the add-on will not perform any image validation. Default value is - false. - :vartype allow_secret_access: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "identities": { - "key": "identities", - "type": "[ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem]", - }, - "allow_secret_access": {"key": "allowSecretAccess", "type": "bool"}, - } - - def __init__( - self, - *, - enabled: Optional[bool] = None, - identities: Optional[list["_models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem"]] = None, - allow_secret_access: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Whether to enable Defender security gating. When enabled, the gating feature - will scan container images and audit or block the deployment of images that do not meet - security standards according to the configured security rules. - :paramtype enabled: bool - :keyword identities: List of identities that the admission controller will make use of in order - to pull security artifacts from the registry. These are the same identities used by the cluster - to pull container images. Each identity provided should have federated identity credential - attached to it. - :paramtype identities: - list[~azure.mgmt.containerservice.models.ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem] - :keyword allow_secret_access: In use only while registry access granted by secret rather than - managed identity. Set whether to grant the Defender gating agent access to the cluster's - secrets for pulling images from registries. If secret access is denied and the registry - requires pull secrets, the add-on will not perform any image validation. Default value is - false. - :paramtype allow_secret_access: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - self.identities = identities - self.allow_secret_access = allow_secret_access - - -class ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem( - _serialization.Model -): # pylint: disable=name-too-long - """ManagedClusterSecurityProfileDefenderSecurityGatingIdentitiesItem. - - :ivar azure_container_registry: The container registry for which the identity will be used; the - identity specified here should have a federated identity credential attached to it. - :vartype azure_container_registry: str - :ivar identity: The identity object used to access the registry. - :vartype identity: ~azure.mgmt.containerservice.models.UserAssignedIdentity - """ - - _attribute_map = { - "azure_container_registry": {"key": "azureContainerRegistry", "type": "str"}, - "identity": {"key": "identity", "type": "UserAssignedIdentity"}, - } - - def __init__( - self, - *, - azure_container_registry: Optional[str] = None, - identity: Optional["_models.UserAssignedIdentity"] = None, - **kwargs: Any - ) -> None: - """ - :keyword azure_container_registry: The container registry for which the identity will be used; - the identity specified here should have a federated identity credential attached to it. - :paramtype azure_container_registry: str - :keyword identity: The identity object used to access the registry. - :paramtype identity: ~azure.mgmt.containerservice.models.UserAssignedIdentity - """ - super().__init__(**kwargs) - self.azure_container_registry = azure_container_registry - self.identity = identity - - -class ManagedClusterSecurityProfileDefenderSecurityMonitoring(_serialization.Model): # pylint: disable=name-too-long - """Microsoft Defender settings for the security profile threat detection. - - :ivar enabled: Whether to enable Defender threat detection. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable Defender threat detection. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterSecurityProfileImageCleaner(_serialization.Model): # pylint: disable=name-too-long - """Image Cleaner removes unused images from nodes, freeing up disk space and helping to reduce - attack surface area. Here are settings for the security profile. - - :ivar enabled: Whether to enable Image Cleaner on AKS cluster. - :vartype enabled: bool - :ivar interval_hours: Image Cleaner scanning interval in hours. - :vartype interval_hours: int - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "interval_hours": {"key": "intervalHours", "type": "int"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, interval_hours: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable Image Cleaner on AKS cluster. - :paramtype enabled: bool - :keyword interval_hours: Image Cleaner scanning interval in hours. - :paramtype interval_hours: int - """ - super().__init__(**kwargs) - self.enabled = enabled - self.interval_hours = interval_hours - - -class ManagedClusterSecurityProfileImageIntegrity(_serialization.Model): # pylint: disable=name-too-long - """Image integrity related settings for the security profile. - - :ivar enabled: Whether to enable image integrity. The default value is false. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable image integrity. The default value is false. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterSecurityProfileNodeRestriction(_serialization.Model): # pylint: disable=name-too-long - """Node Restriction settings for the security profile. - - :ivar enabled: Whether to enable Node Restriction. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable Node Restriction. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterSecurityProfileWorkloadIdentity(_serialization.Model): # pylint: disable=name-too-long - """Workload identity settings for the security profile. - - :ivar enabled: Whether to enable workload identity. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable workload identity. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterServicePrincipalProfile(_serialization.Model): - """Information about a service principal identity for the cluster to use for manipulating Azure - APIs. - - All required parameters must be populated in order to send to server. - - :ivar client_id: The ID for the service principal. Required. - :vartype client_id: str - :ivar secret: The secret password associated with the service principal in plain text. - :vartype secret: str - """ - - _validation = { - "client_id": {"required": True}, - } - - _attribute_map = { - "client_id": {"key": "clientId", "type": "str"}, - "secret": {"key": "secret", "type": "str"}, - } - - def __init__(self, *, client_id: str, secret: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword client_id: The ID for the service principal. Required. - :paramtype client_id: str - :keyword secret: The secret password associated with the service principal in plain text. - :paramtype secret: str - """ - super().__init__(**kwargs) - self.client_id = client_id - self.secret = secret - - -class ManagedClusterSKU(_serialization.Model): - """The SKU of a Managed Cluster. - - :ivar name: The name of a managed cluster SKU. Known values are: "Base" and "Automatic". - :vartype name: str or ~azure.mgmt.containerservice.models.ManagedClusterSKUName - :ivar tier: The tier of a managed cluster SKU. If not specified, the default is 'Free'. See - `AKS Pricing Tier `_ for - more details. Known values are: "Premium", "Standard", and "Free". - :vartype tier: str or ~azure.mgmt.containerservice.models.ManagedClusterSKUTier - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[Union[str, "_models.ManagedClusterSKUName"]] = None, - tier: Optional[Union[str, "_models.ManagedClusterSKUTier"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The name of a managed cluster SKU. Known values are: "Base" and "Automatic". - :paramtype name: str or ~azure.mgmt.containerservice.models.ManagedClusterSKUName - :keyword tier: The tier of a managed cluster SKU. If not specified, the default is 'Free'. See - `AKS Pricing Tier `_ for - more details. Known values are: "Premium", "Standard", and "Free". - :paramtype tier: str or ~azure.mgmt.containerservice.models.ManagedClusterSKUTier - """ - super().__init__(**kwargs) - self.name = name - self.tier = tier - - -class ManagedClusterSnapshot(TrackedResource): - """A managed cluster snapshot resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.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.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.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.models.ManagedClusterPropertiesForSnapshot - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "managed_cluster_properties_read_only": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "creation_data": {"key": "properties.creationData", "type": "CreationData"}, - "snapshot_type": {"key": "properties.snapshotType", "type": "str"}, - "managed_cluster_properties_read_only": { - "key": "properties.managedClusterPropertiesReadOnly", - "type": "ManagedClusterPropertiesForSnapshot", - }, - } - - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - creation_data: Optional["_models.CreationData"] = None, - snapshot_type: Union[str, "_models.SnapshotType"] = "NodePool", - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword creation_data: CreationData to be used to specify the source resource ID to create - this snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.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.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: Optional["_models.ManagedClusterPropertiesForSnapshot"] = 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.models.ManagedClusterSnapshot] - :ivar next_link: The URL to get the next set of managed cluster snapshot results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedClusterSnapshot]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.ManagedClusterSnapshot"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of managed cluster snapshots. - :paramtype value: list[~azure.mgmt.containerservice.models.ManagedClusterSnapshot] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class ManagedClusterStaticEgressGatewayProfile(_serialization.Model): - """The Static Egress Gateway addon configuration for the cluster. - - :ivar enabled: Enable Static Egress Gateway addon. Indicates if Static Egress Gateway addon is - enabled or not. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Enable Static Egress Gateway addon. Indicates if Static Egress Gateway addon - is enabled or not. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterStatus(_serialization.Model): - """Contains read-only information about the Managed Cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_error: The error details information of the managed cluster. Preserves the - detailed info of failure. If there was no error, this field is omitted. - :vartype provisioning_error: ~azure.mgmt.containerservice.models.ErrorDetail - """ - - _validation = { - "provisioning_error": {"readonly": True}, - } - - _attribute_map = { - "provisioning_error": {"key": "provisioningError", "type": "ErrorDetail"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provisioning_error: Optional["_models.ErrorDetail"] = 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.models.ManagedClusterStorageProfileDiskCSIDriver - :ivar file_csi_driver: AzureFile CSI Driver settings for the storage profile. - :vartype file_csi_driver: - ~azure.mgmt.containerservice.models.ManagedClusterStorageProfileFileCSIDriver - :ivar snapshot_controller: Snapshot Controller settings for the storage profile. - :vartype snapshot_controller: - ~azure.mgmt.containerservice.models.ManagedClusterStorageProfileSnapshotController - :ivar blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. - :vartype blob_csi_driver: - ~azure.mgmt.containerservice.models.ManagedClusterStorageProfileBlobCSIDriver - """ - - _attribute_map = { - "disk_csi_driver": {"key": "diskCSIDriver", "type": "ManagedClusterStorageProfileDiskCSIDriver"}, - "file_csi_driver": {"key": "fileCSIDriver", "type": "ManagedClusterStorageProfileFileCSIDriver"}, - "snapshot_controller": {"key": "snapshotController", "type": "ManagedClusterStorageProfileSnapshotController"}, - "blob_csi_driver": {"key": "blobCSIDriver", "type": "ManagedClusterStorageProfileBlobCSIDriver"}, - } - - def __init__( - self, - *, - disk_csi_driver: Optional["_models.ManagedClusterStorageProfileDiskCSIDriver"] = None, - file_csi_driver: Optional["_models.ManagedClusterStorageProfileFileCSIDriver"] = None, - snapshot_controller: Optional["_models.ManagedClusterStorageProfileSnapshotController"] = None, - blob_csi_driver: Optional["_models.ManagedClusterStorageProfileBlobCSIDriver"] = None, - **kwargs: Any - ) -> None: - """ - :keyword disk_csi_driver: AzureDisk CSI Driver settings for the storage profile. - :paramtype disk_csi_driver: - ~azure.mgmt.containerservice.models.ManagedClusterStorageProfileDiskCSIDriver - :keyword file_csi_driver: AzureFile CSI Driver settings for the storage profile. - :paramtype file_csi_driver: - ~azure.mgmt.containerservice.models.ManagedClusterStorageProfileFileCSIDriver - :keyword snapshot_controller: Snapshot Controller settings for the storage profile. - :paramtype snapshot_controller: - ~azure.mgmt.containerservice.models.ManagedClusterStorageProfileSnapshotController - :keyword blob_csi_driver: AzureBlob CSI Driver settings for the storage profile. - :paramtype blob_csi_driver: - ~azure.mgmt.containerservice.models.ManagedClusterStorageProfileBlobCSIDriver - """ - super().__init__(**kwargs) - self.disk_csi_driver = disk_csi_driver - self.file_csi_driver = file_csi_driver - self.snapshot_controller = snapshot_controller - self.blob_csi_driver = blob_csi_driver - - -class ManagedClusterStorageProfileBlobCSIDriver(_serialization.Model): # pylint: disable=name-too-long - """AzureBlob CSI Driver settings for the storage profile. - - :ivar enabled: Whether to enable AzureBlob CSI Driver. The default value is false. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable AzureBlob CSI Driver. The default value is false. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterStorageProfileDiskCSIDriver(_serialization.Model): # pylint: disable=name-too-long - """AzureDisk CSI Driver settings for the storage profile. - - :ivar enabled: Whether to enable AzureDisk CSI Driver. The default value is true. - :vartype enabled: bool - :ivar version: The version of AzureDisk CSI Driver. The default value is v1. - :vartype version: str - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "version": {"key": "version", "type": "str"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, version: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable AzureDisk CSI Driver. The default value is true. - :paramtype enabled: bool - :keyword version: The version of AzureDisk CSI Driver. The default value is v1. - :paramtype version: str - """ - super().__init__(**kwargs) - self.enabled = enabled - self.version = version - - -class ManagedClusterStorageProfileFileCSIDriver(_serialization.Model): # pylint: disable=name-too-long - """AzureFile CSI Driver settings for the storage profile. - - :ivar enabled: Whether to enable AzureFile CSI Driver. The default value is true. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable AzureFile CSI Driver. The default value is true. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterStorageProfileSnapshotController(_serialization.Model): # pylint: disable=name-too-long - """Snapshot Controller settings for the storage profile. - - :ivar enabled: Whether to enable Snapshot Controller. The default value is true. - :vartype enabled: bool - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable Snapshot Controller. The default value is true. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterUpgradeProfile(_serialization.Model): - """The list of available upgrades for compute pools. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The ID of the upgrade profile. - :vartype id: str - :ivar name: The name of the upgrade profile. - :vartype name: str - :ivar type: The type of the upgrade profile. - :vartype type: str - :ivar control_plane_profile: The list of available upgrade versions for the control plane. - Required. - :vartype control_plane_profile: - ~azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfile - :ivar agent_pool_profiles: The list of available upgrade versions for agent pools. Required. - :vartype agent_pool_profiles: - list[~azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfile] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "control_plane_profile": {"required": True}, - "agent_pool_profiles": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "control_plane_profile": {"key": "properties.controlPlaneProfile", "type": "ManagedClusterPoolUpgradeProfile"}, - "agent_pool_profiles": {"key": "properties.agentPoolProfiles", "type": "[ManagedClusterPoolUpgradeProfile]"}, - } - - def __init__( - self, - *, - control_plane_profile: "_models.ManagedClusterPoolUpgradeProfile", - agent_pool_profiles: list["_models.ManagedClusterPoolUpgradeProfile"], - **kwargs: Any - ) -> None: - """ - :keyword control_plane_profile: The list of available upgrade versions for the control plane. - Required. - :paramtype control_plane_profile: - ~azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfile - :keyword agent_pool_profiles: The list of available upgrade versions for agent pools. Required. - :paramtype agent_pool_profiles: - list[~azure.mgmt.containerservice.models.ManagedClusterPoolUpgradeProfile] - """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - self.control_plane_profile = control_plane_profile - self.agent_pool_profiles = agent_pool_profiles - - -class ManagedClusterWindowsProfile(_serialization.Model): - """Profile for Windows VMs in the managed cluster. - - All required parameters must be populated in order to send to server. - - :ivar admin_username: Specifies the name of the administrator account. :code:`
`\\ - :code:`
` **Restriction:** Cannot end in "." :code:`
`\\ :code:`
` **Disallowed - values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", - "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", - "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", - "test2", "test3", "user4", "user5". :code:`
`\\ :code:`
` **Minimum-length:** 1 character - :code:`
`\\ :code:`
` **Max-length:** 20 characters. Required. - :vartype admin_username: str - :ivar admin_password: Specifies the password of the administrator account. :code:`
`\\ - :code:`
` **Minimum-length:** 8 characters :code:`
`\\ :code:`
` **Max-length:** 123 - characters :code:`
`\\ :code:`
` **Complexity requirements:** 3 out of 4 conditions below - need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters - :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) - :code:`
`\\ :code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :vartype admin_password: str - :ivar license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits - `_ for more details. Known values are: - "None" and "Windows_Server". - :vartype license_type: str or ~azure.mgmt.containerservice.models.LicenseType - :ivar enable_csi_proxy: Whether to 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.models.WindowsGmsaProfile - """ - - _validation = { - "admin_username": {"required": True}, - } - - _attribute_map = { - "admin_username": {"key": "adminUsername", "type": "str"}, - "admin_password": {"key": "adminPassword", "type": "str"}, - "license_type": {"key": "licenseType", "type": "str"}, - "enable_csi_proxy": {"key": "enableCSIProxy", "type": "bool"}, - "gmsa_profile": {"key": "gmsaProfile", "type": "WindowsGmsaProfile"}, - } - - def __init__( - self, - *, - admin_username: str, - admin_password: Optional[str] = None, - license_type: Optional[Union[str, "_models.LicenseType"]] = None, - enable_csi_proxy: Optional[bool] = None, - gmsa_profile: Optional["_models.WindowsGmsaProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword admin_username: Specifies the name of the administrator account. :code:`
`\\ - :code:`
` **Restriction:** Cannot end in "." :code:`
`\\ :code:`
` **Disallowed - values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", - "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", - "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", - "test2", "test3", "user4", "user5". :code:`
`\\ :code:`
` **Minimum-length:** 1 character - :code:`
`\\ :code:`
` **Max-length:** 20 characters. Required. - :paramtype admin_username: str - :keyword admin_password: Specifies the password of the administrator account. :code:`
`\\ - :code:`
` **Minimum-length:** 8 characters :code:`
`\\ :code:`
` **Max-length:** 123 - characters :code:`
`\\ :code:`
` **Complexity requirements:** 3 out of 4 conditions below - need to be fulfilled :code:`
` Has lower characters :code:`
`Has upper characters - :code:`
` Has a digit :code:`
` Has a special character (Regex match [\\W_]) - :code:`
`\\ :code:`
` **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", - "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!". - :paramtype admin_password: str - :keyword license_type: The license type to use for Windows VMs. See `Azure Hybrid User Benefits - `_ for more details. Known values are: - "None" and "Windows_Server". - :paramtype license_type: str or ~azure.mgmt.containerservice.models.LicenseType - :keyword enable_csi_proxy: Whether to 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.models.WindowsGmsaProfile - """ - super().__init__(**kwargs) - self.admin_username = admin_username - self.admin_password = admin_password - self.license_type = license_type - self.enable_csi_proxy = enable_csi_proxy - self.gmsa_profile = gmsa_profile - - -class ManagedClusterWorkloadAutoScalerProfile(_serialization.Model): - """Workload Auto-scaler profile for the managed cluster. - - :ivar keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler - profile. - :vartype keda: ~azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfileKeda - :ivar vertical_pod_autoscaler: - :vartype vertical_pod_autoscaler: - ~azure.mgmt.containerservice.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: Any - ) -> None: - """ - :keyword keda: KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler - profile. - :paramtype keda: - ~azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfileKeda - :keyword vertical_pod_autoscaler: - :paramtype vertical_pod_autoscaler: - ~azure.mgmt.containerservice.models.ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler - """ - super().__init__(**kwargs) - self.keda = keda - self.vertical_pod_autoscaler = vertical_pod_autoscaler - - -class ManagedClusterWorkloadAutoScalerProfileKeda(_serialization.Model): # pylint: disable=name-too-long - """KEDA (Kubernetes Event-driven Autoscaling) settings for the workload auto-scaler profile. - - All required parameters must be populated in order to send to server. - - :ivar enabled: Whether to enable KEDA. Required. - :vartype enabled: bool - """ - - _validation = { - "enabled": {"required": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - } - - def __init__(self, *, enabled: bool, **kwargs: Any) -> None: - """ - :keyword enabled: Whether to enable KEDA. Required. - :paramtype enabled: bool - """ - super().__init__(**kwargs) - self.enabled = enabled - - -class ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler( - _serialization.Model -): # pylint: disable=name-too-long - """ManagedClusterWorkloadAutoScalerProfileVerticalPodAutoscaler. - - All required parameters must be populated in order to send to server. - - :ivar enabled: Whether to enable VPA add-on in cluster. Default value is false. Required. - :vartype enabled: bool - :ivar addon_autoscaling: Whether VPA add-on is enabled and configured to scale AKS-managed - add-ons. Known values are: "Enabled" and "Disabled". - :vartype addon_autoscaling: str or ~azure.mgmt.containerservice.models.AddonAutoscaling - """ - - _validation = { - "enabled": {"required": True}, - } - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "addon_autoscaling": {"key": "addonAutoscaling", "type": "str"}, - } - - def __init__( - self, - *, - enabled: bool = False, - addon_autoscaling: Union[str, "_models.AddonAutoscaling"] = "Disabled", - **kwargs: Any - ) -> None: - """ - :keyword enabled: Whether to enable VPA add-on in cluster. Default value is false. Required. - :paramtype enabled: bool - :keyword addon_autoscaling: Whether VPA add-on is enabled and configured to scale AKS-managed - add-ons. Known values are: "Enabled" and "Disabled". - :paramtype addon_autoscaling: str or ~azure.mgmt.containerservice.models.AddonAutoscaling - """ - super().__init__(**kwargs) - self.enabled = enabled - self.addon_autoscaling = addon_autoscaling - - -class ManagedNamespace(SubResource): - """Namespace managed by ARM. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: The name of the resource that is unique within a resource group. This name can be - used to access the resource. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.containerservice.models.SystemData - :ivar tags: The tags to be persisted on the managed cluster namespace. - :vartype tags: dict[str, str] - :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value - will change when the resource is updated. Specify an if-match or if-none-match header with the - eTag value for a subsequent request to enable optimistic concurrency per the normal eTag - convention. - :vartype e_tag: str - :ivar location: The location of the namespace. - :vartype location: str - :ivar properties: Properties of a namespace. - :vartype properties: ~azure.mgmt.containerservice.models.NamespaceProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "e_tag": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "e_tag": {"key": "eTag", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "properties": {"key": "properties", "type": "NamespaceProperties"}, - } - - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - location: Optional[str] = None, - properties: Optional["_models.NamespaceProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: The tags to be persisted on the managed cluster namespace. - :paramtype tags: dict[str, str] - :keyword location: The location of the namespace. - :paramtype location: str - :keyword properties: Properties of a namespace. - :paramtype properties: ~azure.mgmt.containerservice.models.NamespaceProperties - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.tags = tags - self.e_tag: Optional[str] = None - self.location = location - self.properties = properties - - -class ManagedNamespaceListResult(_serialization.Model): - """The result of a request to list managed namespaces in a managed cluster. - - :ivar value: The list of managed namespaces. - :vartype value: list[~azure.mgmt.containerservice.models.ManagedNamespace] - :ivar next_link: The URI to fetch the next page of results, if any. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedNamespace]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__( - self, - *, - value: Optional[list["_models.ManagedNamespace"]] = None, - next_link: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword value: The list of managed namespaces. - :paramtype value: list[~azure.mgmt.containerservice.models.ManagedNamespace] - :keyword next_link: The URI to fetch the next page of results, if any. - :paramtype next_link: str - """ - super().__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class ManagedServiceIdentityUserAssignedIdentitiesValue(_serialization.Model): # pylint: disable=name-too-long - """ManagedServiceIdentityUserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str - """ - - _validation = { - "principal_id": {"readonly": True}, - "client_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.principal_id: Optional[str] = None - self.client_id: Optional[str] = None - - -class ManualScaleProfile(_serialization.Model): - """Specifications on number of machines. - - :ivar size: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', - 'Standard_E16s_v3' or 'Standard_D16s_v5'. - :vartype size: str - :ivar count: Number of nodes. - :vartype count: int - """ - - _attribute_map = { - "size": {"key": "size", "type": "str"}, - "count": {"key": "count", "type": "int"}, - } - - def __init__(self, *, size: Optional[str] = None, count: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword size: VM size that AKS will use when creating and scaling e.g. 'Standard_E4s_v3', - 'Standard_E16s_v3' or 'Standard_D16s_v5'. - :paramtype size: str - :keyword count: Number of nodes. - :paramtype count: int - """ - super().__init__(**kwargs) - self.size = size - self.count = count - - -class MeshMembership(ProxyResource): - """Mesh membership of a managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.containerservice.models.SystemData - :ivar managed_by: The fully qualified resource ID of the resource that manages this resource. - Indicates if this resource is managed by another Azure resource. If this is present, complete - mode deployment will not delete the resource if it is removed from the template since it is - managed by another resource. - :vartype managed_by: str - :ivar e_tag: Unique read-only string used to implement optimistic concurrency. The eTag value - will change when the resource is updated. Specify an if-match or if-none-match header with the - eTag value for a subsequent request to enable optimistic concurrency per the normal eTag - convention. - :vartype e_tag: str - :ivar properties: Mesh membership properties of a managed cluster. - :vartype properties: ~azure.mgmt.containerservice.models.MeshMembershipProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "e_tag": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "managed_by": {"key": "managedBy", "type": "str"}, - "e_tag": {"key": "eTag", "type": "str"}, - "properties": {"key": "properties", "type": "MeshMembershipProperties"}, - } - - def __init__( - self, - *, - managed_by: Optional[str] = None, - properties: Optional["_models.MeshMembershipProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword managed_by: The fully qualified resource ID of the resource that manages this - resource. Indicates if this resource is managed by another Azure resource. If this is present, - complete mode deployment will not delete the resource if it is removed from the template since - it is managed by another resource. - :paramtype managed_by: str - :keyword properties: Mesh membership properties of a managed cluster. - :paramtype properties: ~azure.mgmt.containerservice.models.MeshMembershipProperties - """ - super().__init__(**kwargs) - self.managed_by = managed_by - self.e_tag: Optional[str] = None - self.properties = properties - - -class MeshMembershipProperties(_serialization.Model): - """Mesh membership properties of a managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar provisioning_state: The current provisioning state of the Mesh Membership. Known values - are: "Canceled", "Creating", "Deleting", "Failed", "Succeeded", and "Updating". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.models.MeshMembershipProvisioningState - :ivar managed_mesh_id: The ARM resource id for the managed mesh member. This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/applinks/{appLinkName}/appLinkMembers/{appLinkMemberName}'. - Visit https://aka.ms/applink for more information. Required. - :vartype managed_mesh_id: str - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "managed_mesh_id": {"required": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "managed_mesh_id": {"key": "managedMeshID", "type": "str"}, - } - - def __init__(self, *, managed_mesh_id: str, **kwargs: Any) -> None: - """ - :keyword managed_mesh_id: The ARM resource id for the managed mesh member. This is of the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppLink/applinks/{appLinkName}/appLinkMembers/{appLinkMemberName}'. - Visit https://aka.ms/applink for more information. Required. - :paramtype managed_mesh_id: str - """ - super().__init__(**kwargs) - self.provisioning_state: Optional[Union[str, "_models.MeshMembershipProvisioningState"]] = None - self.managed_mesh_id = managed_mesh_id - - -class MeshMembershipsListResult(_serialization.Model): - """The result of a request to list mesh memberships in a managed cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of mesh memberships. - :vartype value: list[~azure.mgmt.containerservice.models.MeshMembership] - :ivar next_link: The URL to get the next set of mesh membership results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[MeshMembership]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.MeshMembership"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of mesh memberships. - :paramtype value: list[~azure.mgmt.containerservice.models.MeshMembership] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class MeshRevision(_serialization.Model): - """Holds information on upgrades and compatibility for given major.minor mesh release. - - :ivar revision: The revision of the mesh release. - :vartype revision: str - :ivar upgrades: List of revisions available for upgrade of a specific mesh revision. - :vartype upgrades: list[str] - :ivar compatible_with: List of items this revision of service mesh is compatible with, and - their associated versions. - :vartype compatible_with: list[~azure.mgmt.containerservice.models.CompatibleVersions] - """ - - _attribute_map = { - "revision": {"key": "revision", "type": "str"}, - "upgrades": {"key": "upgrades", "type": "[str]"}, - "compatible_with": {"key": "compatibleWith", "type": "[CompatibleVersions]"}, - } - - def __init__( - self, - *, - revision: Optional[str] = None, - upgrades: Optional[list[str]] = None, - compatible_with: Optional[list["_models.CompatibleVersions"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword revision: The revision of the mesh release. - :paramtype revision: str - :keyword upgrades: List of revisions available for upgrade of a specific mesh revision. - :paramtype upgrades: list[str] - :keyword compatible_with: List of items this revision of service mesh is compatible with, and - their associated versions. - :paramtype compatible_with: list[~azure.mgmt.containerservice.models.CompatibleVersions] - """ - super().__init__(**kwargs) - self.revision = revision - self.upgrades = upgrades - self.compatible_with = compatible_with - - -class MeshRevisionProfile(ProxyResource): - """Mesh revision profile for a mesh. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - :ivar properties: Mesh revision profile properties for a mesh. - :vartype properties: ~azure.mgmt.containerservice.models.MeshRevisionProfileProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "MeshRevisionProfileProperties"}, - } - - def __init__(self, *, properties: Optional["_models.MeshRevisionProfileProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: Mesh revision profile properties for a mesh. - :paramtype properties: ~azure.mgmt.containerservice.models.MeshRevisionProfileProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class MeshRevisionProfileList(_serialization.Model): - """Holds an array of MeshRevisionsProfiles. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of service mesh add-on revision profiles for all supported mesh modes. - :vartype value: list[~azure.mgmt.containerservice.models.MeshRevisionProfile] - :ivar next_link: The URL to get the next set of mesh revision profile. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[MeshRevisionProfile]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.MeshRevisionProfile"]] = None, **kwargs: Any) -> None: - """ - :keyword value: Array of service mesh add-on revision profiles for all supported mesh modes. - :paramtype value: list[~azure.mgmt.containerservice.models.MeshRevisionProfile] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class MeshRevisionProfileProperties(_serialization.Model): - """Mesh revision profile properties for a mesh. - - :ivar mesh_revisions: - :vartype mesh_revisions: list[~azure.mgmt.containerservice.models.MeshRevision] - """ - - _attribute_map = { - "mesh_revisions": {"key": "meshRevisions", "type": "[MeshRevision]"}, - } - - def __init__(self, *, mesh_revisions: Optional[list["_models.MeshRevision"]] = None, **kwargs: Any) -> None: - """ - :keyword mesh_revisions: - :paramtype mesh_revisions: list[~azure.mgmt.containerservice.models.MeshRevision] - """ - super().__init__(**kwargs) - self.mesh_revisions = mesh_revisions - - -class MeshUpgradeProfile(ProxyResource): - """Upgrade profile for given mesh. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - :ivar properties: Mesh upgrade profile properties for a major.minor release. - :vartype properties: ~azure.mgmt.containerservice.models.MeshUpgradeProfileProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "MeshUpgradeProfileProperties"}, - } - - def __init__(self, *, properties: Optional["_models.MeshUpgradeProfileProperties"] = None, **kwargs: Any) -> None: - """ - :keyword properties: Mesh upgrade profile properties for a major.minor release. - :paramtype properties: ~azure.mgmt.containerservice.models.MeshUpgradeProfileProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class MeshUpgradeProfileList(_serialization.Model): - """Holds an array of MeshUpgradeProfiles. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of supported service mesh add-on upgrade profiles. - :vartype value: list[~azure.mgmt.containerservice.models.MeshUpgradeProfile] - :ivar next_link: The URL to get the next set of mesh upgrade profile. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[MeshUpgradeProfile]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.MeshUpgradeProfile"]] = None, **kwargs: Any) -> None: - """ - :keyword value: Array of supported service mesh add-on upgrade profiles. - :paramtype value: list[~azure.mgmt.containerservice.models.MeshUpgradeProfile] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class MeshUpgradeProfileProperties(MeshRevision): - """Mesh upgrade profile properties for a major.minor release. - - :ivar revision: The revision of the mesh release. - :vartype revision: str - :ivar upgrades: List of revisions available for upgrade of a specific mesh revision. - :vartype upgrades: list[str] - :ivar compatible_with: List of items this revision of service mesh is compatible with, and - their associated versions. - :vartype compatible_with: list[~azure.mgmt.containerservice.models.CompatibleVersions] - """ - - -class NamespaceProperties(_serialization.Model): - """Properties of a namespace managed by ARM. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provisioning_state: The current provisioning state of the namespace. Known values are: - "Updating", "Deleting", "Creating", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.models.NamespaceProvisioningState - :ivar labels: The labels of managed namespace. - :vartype labels: dict[str, str] - :ivar annotations: The annotations of managed namespace. - :vartype annotations: dict[str, str] - :ivar portal_fqdn: The special FQDN used by the Azure Portal to access the Managed Cluster. - This FQDN is for use only by the Azure Portal and should not be used by other clients. 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 portal_fqdn: str - :ivar default_resource_quota: The default resource quota enforced upon the namespace. Customers - can have other Kubernetes resource quota objects under the namespace. Resource quotas are - additive; if multiple resource quotas are applied to a given namespace, then the effective - limit will be one such that all quotas on the namespace can be satisfied. - :vartype default_resource_quota: ~azure.mgmt.containerservice.models.ResourceQuota - :ivar default_network_policy: The default network policy enforced upon the namespace. Customers - can have other Kubernetes network policy objects under the namespace. Network policies are - additive; if a policy or policies apply to a given pod for a given direction, the connections - allowed in that direction for the pod is the union of what all applicable policies allow. - :vartype default_network_policy: ~azure.mgmt.containerservice.models.NetworkPolicies - :ivar adoption_policy: Action if Kubernetes namespace with same name already exists. Known - values are: "Never", "IfIdentical", and "Always". - :vartype adoption_policy: str or ~azure.mgmt.containerservice.models.AdoptionPolicy - :ivar delete_policy: Delete options of a namespace. Known values are: "Keep" and "Delete". - :vartype delete_policy: str or ~azure.mgmt.containerservice.models.DeletePolicy - """ - - _validation = { - "provisioning_state": {"readonly": True}, - "portal_fqdn": {"readonly": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "labels": {"key": "labels", "type": "{str}"}, - "annotations": {"key": "annotations", "type": "{str}"}, - "portal_fqdn": {"key": "portalFqdn", "type": "str"}, - "default_resource_quota": {"key": "defaultResourceQuota", "type": "ResourceQuota"}, - "default_network_policy": {"key": "defaultNetworkPolicy", "type": "NetworkPolicies"}, - "adoption_policy": {"key": "adoptionPolicy", "type": "str"}, - "delete_policy": {"key": "deletePolicy", "type": "str"}, - } - - def __init__( - self, - *, - labels: Optional[dict[str, str]] = None, - annotations: Optional[dict[str, str]] = None, - default_resource_quota: Optional["_models.ResourceQuota"] = None, - default_network_policy: Optional["_models.NetworkPolicies"] = None, - adoption_policy: Optional[Union[str, "_models.AdoptionPolicy"]] = None, - delete_policy: Optional[Union[str, "_models.DeletePolicy"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword labels: The labels of managed namespace. - :paramtype labels: dict[str, str] - :keyword annotations: The annotations of managed namespace. - :paramtype annotations: dict[str, str] - :keyword default_resource_quota: The default resource quota enforced upon the namespace. - Customers can have other Kubernetes resource quota objects under the namespace. Resource quotas - are additive; if multiple resource quotas are applied to a given namespace, then the effective - limit will be one such that all quotas on the namespace can be satisfied. - :paramtype default_resource_quota: ~azure.mgmt.containerservice.models.ResourceQuota - :keyword default_network_policy: The default network policy enforced upon the namespace. - Customers can have other Kubernetes network policy objects under the namespace. Network - policies are additive; if a policy or policies apply to a given pod for a given direction, the - connections allowed in that direction for the pod is the union of what all applicable policies - allow. - :paramtype default_network_policy: ~azure.mgmt.containerservice.models.NetworkPolicies - :keyword adoption_policy: Action if Kubernetes namespace with same name already exists. Known - values are: "Never", "IfIdentical", and "Always". - :paramtype adoption_policy: str or ~azure.mgmt.containerservice.models.AdoptionPolicy - :keyword delete_policy: Delete options of a namespace. Known values are: "Keep" and "Delete". - :paramtype delete_policy: str or ~azure.mgmt.containerservice.models.DeletePolicy - """ - super().__init__(**kwargs) - self.provisioning_state: Optional[Union[str, "_models.NamespaceProvisioningState"]] = None - self.labels = labels - self.annotations = annotations - self.portal_fqdn: Optional[str] = None - self.default_resource_quota = default_resource_quota - self.default_network_policy = default_network_policy - self.adoption_policy = adoption_policy - self.delete_policy = delete_policy - - -class NetworkPolicies(_serialization.Model): - """Default network policy of the namespace, specifying ingress and egress rules. - - :ivar ingress: Ingress policy for the network. Known values are: "DenyAll", "AllowAll", and - "AllowSameNamespace". - :vartype ingress: str or ~azure.mgmt.containerservice.models.PolicyRule - :ivar egress: Egress policy for the network. Known values are: "DenyAll", "AllowAll", and - "AllowSameNamespace". - :vartype egress: str or ~azure.mgmt.containerservice.models.PolicyRule - """ - - _attribute_map = { - "ingress": {"key": "ingress", "type": "str"}, - "egress": {"key": "egress", "type": "str"}, - } - - def __init__( - self, - *, - ingress: Optional[Union[str, "_models.PolicyRule"]] = None, - egress: Optional[Union[str, "_models.PolicyRule"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword ingress: Ingress policy for the network. Known values are: "DenyAll", "AllowAll", and - "AllowSameNamespace". - :paramtype ingress: str or ~azure.mgmt.containerservice.models.PolicyRule - :keyword egress: Egress policy for the network. Known values are: "DenyAll", "AllowAll", and - "AllowSameNamespace". - :paramtype egress: str or ~azure.mgmt.containerservice.models.PolicyRule - """ - super().__init__(**kwargs) - self.ingress = ingress - self.egress = egress - - -class NetworkProfileForSnapshot(_serialization.Model): - """network profile for managed cluster snapshot, these properties are read only. - - :ivar network_plugin: networkPlugin for managed cluster snapshot. Known values are: "azure", - "kubenet", and "none". - :vartype network_plugin: str or ~azure.mgmt.containerservice.models.NetworkPlugin - :ivar network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" - :vartype network_plugin_mode: str or ~azure.mgmt.containerservice.models.NetworkPluginMode - :ivar network_policy: networkPolicy for managed cluster snapshot. Known values are: "none", - "calico", "azure", and "cilium". - :vartype network_policy: str or ~azure.mgmt.containerservice.models.NetworkPolicy - :ivar network_mode: networkMode for managed cluster snapshot. Known values are: "transparent" - and "bridge". - :vartype network_mode: str or ~azure.mgmt.containerservice.models.NetworkMode - :ivar load_balancer_sku: loadBalancerSku for managed cluster snapshot. Known values are: - "standard" and "basic". - :vartype load_balancer_sku: str or ~azure.mgmt.containerservice.models.LoadBalancerSku - """ - - _attribute_map = { - "network_plugin": {"key": "networkPlugin", "type": "str"}, - "network_plugin_mode": {"key": "networkPluginMode", "type": "str"}, - "network_policy": {"key": "networkPolicy", "type": "str"}, - "network_mode": {"key": "networkMode", "type": "str"}, - "load_balancer_sku": {"key": "loadBalancerSku", "type": "str"}, - } - - def __init__( - self, - *, - network_plugin: Optional[Union[str, "_models.NetworkPlugin"]] = None, - network_plugin_mode: Optional[Union[str, "_models.NetworkPluginMode"]] = None, - network_policy: Optional[Union[str, "_models.NetworkPolicy"]] = None, - network_mode: Optional[Union[str, "_models.NetworkMode"]] = None, - load_balancer_sku: Optional[Union[str, "_models.LoadBalancerSku"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword network_plugin: networkPlugin for managed cluster snapshot. Known values are: "azure", - "kubenet", and "none". - :paramtype network_plugin: str or ~azure.mgmt.containerservice.models.NetworkPlugin - :keyword network_plugin_mode: NetworkPluginMode for managed cluster snapshot. "overlay" - :paramtype network_plugin_mode: str or ~azure.mgmt.containerservice.models.NetworkPluginMode - :keyword network_policy: networkPolicy for managed cluster snapshot. Known values are: "none", - "calico", "azure", and "cilium". - :paramtype network_policy: str or ~azure.mgmt.containerservice.models.NetworkPolicy - :keyword network_mode: networkMode for managed cluster snapshot. Known values are: - "transparent" and "bridge". - :paramtype network_mode: str or ~azure.mgmt.containerservice.models.NetworkMode - :keyword load_balancer_sku: loadBalancerSku for managed cluster snapshot. Known values are: - "standard" and "basic". - :paramtype load_balancer_sku: str or ~azure.mgmt.containerservice.models.LoadBalancerSku - """ - super().__init__(**kwargs) - self.network_plugin = network_plugin - self.network_plugin_mode = network_plugin_mode - self.network_policy = network_policy - self.network_mode = network_mode - self.load_balancer_sku = load_balancer_sku - - -class NodeCustomizationProfile(_serialization.Model): - """Settings to determine the node customization used to provision nodes in a pool. - - :ivar node_customization_id: The resource ID of the node customization resource to use. This - can be a version. Omitting the version will use the latest version of the node customization. - :vartype node_customization_id: str - """ - - _attribute_map = { - "node_customization_id": {"key": "nodeCustomizationId", "type": "str"}, - } - - def __init__(self, *, node_customization_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword node_customization_id: The resource ID of the node customization resource to use. This - can be a version. Omitting the version will use the latest version of the node customization. - :paramtype node_customization_id: str - """ - super().__init__(**kwargs) - self.node_customization_id = node_customization_id - - -class NodeImageVersion(_serialization.Model): - """node image version profile for given major.minor.patch release. - - :ivar os: The operating system of the node image. Example: AKSUbuntu. - :vartype os: str - :ivar sku: The SKU or flavor of the node image. Example: 2004gen2containerd. - :vartype sku: str - :ivar version: major.minor.patch version of the node image version release. Example: - 2024.02.02. - :vartype version: str - :ivar full_name: The OS + SKU + version of the node image. Example: - AKSUbuntu-1804gen2containerd-2024.02.02. - :vartype full_name: str - """ - - _attribute_map = { - "os": {"key": "os", "type": "str"}, - "sku": {"key": "sku", "type": "str"}, - "version": {"key": "version", "type": "str"}, - "full_name": {"key": "fullName", "type": "str"}, - } - - def __init__( - self, - *, - os: Optional[str] = None, - sku: Optional[str] = None, - version: Optional[str] = None, - full_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword os: The operating system of the node image. Example: AKSUbuntu. - :paramtype os: str - :keyword sku: The SKU or flavor of the node image. Example: 2004gen2containerd. - :paramtype sku: str - :keyword version: major.minor.patch version of the node image version release. Example: - 2024.02.02. - :paramtype version: str - :keyword full_name: The OS + SKU + version of the node image. Example: - AKSUbuntu-1804gen2containerd-2024.02.02. - :paramtype full_name: str - """ - super().__init__(**kwargs) - self.os = os - self.sku = sku - self.version = version - self.full_name = full_name - - -class NodeImageVersionsListResult(_serialization.Model): - """Holds an array NodeImageVersions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of AKS Node Image versions. - :vartype value: list[~azure.mgmt.containerservice.models.NodeImageVersion] - :ivar next_link: The URL to get the next set of machine results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[NodeImageVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.NodeImageVersion"]] = None, **kwargs: Any) -> None: - """ - :keyword value: Array of AKS Node Image versions. - :paramtype value: list[~azure.mgmt.containerservice.models.NodeImageVersion] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class OperationListResult(_serialization.Model): - """The List Operation response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of operations. - :vartype value: list[~azure.mgmt.containerservice.models.OperationValue] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[OperationValue]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.OperationValue"]] = None - - -class OperationStatusResult(_serialization.Model): - """The current status of an async operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified ID for the async operation. - :vartype id: str - :ivar resource_id: Fully qualified ID of the resource against which the original async - operation was started. - :vartype resource_id: str - :ivar name: Name of the async operation. - :vartype name: str - :ivar status: Operation status. Required. - :vartype status: str - :ivar percent_complete: Percent of the operation that is complete. - :vartype percent_complete: float - :ivar start_time: The start time of the operation. - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time of the operation. - :vartype end_time: ~datetime.datetime - :ivar operations: The operations list. - :vartype operations: list[~azure.mgmt.containerservice.models.OperationStatusResult] - :ivar error: If present, details of the operation error. - :vartype error: ~azure.mgmt.containerservice.models.ErrorDetail - """ - - _validation = { - "resource_id": {"readonly": True}, - "status": {"required": True}, - "percent_complete": {"maximum": 100, "minimum": 0}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "resource_id": {"key": "resourceId", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "percent_complete": {"key": "percentComplete", "type": "float"}, - "start_time": {"key": "startTime", "type": "iso-8601"}, - "end_time": {"key": "endTime", "type": "iso-8601"}, - "operations": {"key": "operations", "type": "[OperationStatusResult]"}, - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__( - self, - *, - status: str, - id: Optional[str] = None, # pylint: disable=redefined-builtin - name: Optional[str] = None, - percent_complete: Optional[float] = None, - start_time: Optional[datetime.datetime] = None, - end_time: Optional[datetime.datetime] = None, - operations: Optional[list["_models.OperationStatusResult"]] = None, - error: Optional["_models.ErrorDetail"] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: Fully qualified ID for the async operation. - :paramtype id: str - :keyword name: Name of the async operation. - :paramtype name: str - :keyword status: Operation status. Required. - :paramtype status: str - :keyword percent_complete: Percent of the operation that is complete. - :paramtype percent_complete: float - :keyword start_time: The start time of the operation. - :paramtype start_time: ~datetime.datetime - :keyword end_time: The end time of the operation. - :paramtype end_time: ~datetime.datetime - :keyword operations: The operations list. - :paramtype operations: list[~azure.mgmt.containerservice.models.OperationStatusResult] - :keyword error: If present, details of the operation error. - :paramtype error: ~azure.mgmt.containerservice.models.ErrorDetail - """ - super().__init__(**kwargs) - self.id = id - self.resource_id: Optional[str] = None - self.name = name - self.status = status - self.percent_complete = percent_complete - self.start_time = start_time - self.end_time = end_time - self.operations = operations - self.error = error - - -class OperationStatusResultList(_serialization.Model): - """The operations list. It contains an URL link to get the next set of results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of operations. - :vartype value: list[~azure.mgmt.containerservice.models.OperationStatusResult] - :ivar next_link: URL to get the next set of operation list results (if there are any). - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[OperationStatusResult]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.OperationStatusResult"]] = None - self.next_link: Optional[str] = None - - -class OperationValue(_serialization.Model): - """Describes the properties of a Operation value. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar origin: The origin of the operation. - :vartype origin: str - :ivar name: The name of the operation. - :vartype name: str - :ivar operation: The display name of the operation. - :vartype operation: str - :ivar resource: The display name of the resource the operation applies to. - :vartype resource: str - :ivar description: The description of the operation. - :vartype description: str - :ivar provider: The resource provider for the operation. - :vartype provider: str - """ - - _validation = { - "origin": {"readonly": True}, - "name": {"readonly": True}, - "operation": {"readonly": True}, - "resource": {"readonly": True}, - "description": {"readonly": True}, - "provider": {"readonly": True}, - } - - _attribute_map = { - "origin": {"key": "origin", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "operation": {"key": "display.operation", "type": "str"}, - "resource": {"key": "display.resource", "type": "str"}, - "description": {"key": "display.description", "type": "str"}, - "provider": {"key": "display.provider", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.origin: Optional[str] = None - self.name: Optional[str] = None - self.operation: Optional[str] = None - self.resource: Optional[str] = None - self.description: Optional[str] = None - self.provider: Optional[str] = None - - -class OutboundEnvironmentEndpoint(_serialization.Model): - """Egress endpoints which AKS agent nodes connect to for common purpose. - - :ivar category: The category of endpoints accessed by the AKS agent node, e.g. - azure-resource-management, apiserver, etc. - :vartype category: str - :ivar endpoints: The endpoints that AKS agent nodes connect to. - :vartype endpoints: list[~azure.mgmt.containerservice.models.EndpointDependency] - """ - - _attribute_map = { - "category": {"key": "category", "type": "str"}, - "endpoints": {"key": "endpoints", "type": "[EndpointDependency]"}, - } - - def __init__( - self, - *, - category: Optional[str] = None, - endpoints: Optional[list["_models.EndpointDependency"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword category: The category of endpoints accessed by the AKS agent node, e.g. - azure-resource-management, apiserver, etc. - :paramtype category: str - :keyword endpoints: The endpoints that AKS agent nodes connect to. - :paramtype endpoints: list[~azure.mgmt.containerservice.models.EndpointDependency] - """ - super().__init__(**kwargs) - self.category = category - self.endpoints = endpoints - - -class OutboundEnvironmentEndpointCollection(_serialization.Model): - """Collection of OutboundEnvironmentEndpoint. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar value: Collection of resources. Required. - :vartype value: list[~azure.mgmt.containerservice.models.OutboundEnvironmentEndpoint] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"required": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[OutboundEnvironmentEndpoint]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: list["_models.OutboundEnvironmentEndpoint"], **kwargs: Any) -> None: - """ - :keyword value: Collection of resources. Required. - :paramtype value: list[~azure.mgmt.containerservice.models.OutboundEnvironmentEndpoint] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class PortRange(_serialization.Model): - """The port range. - - :ivar port_start: The minimum port that is included in the range. It should be ranged from 1 to - 65535, and be less than or equal to portEnd. - :vartype port_start: int - :ivar port_end: The maximum port that is included in the range. It should be ranged from 1 to - 65535, and be greater than or equal to portStart. - :vartype port_end: int - :ivar protocol: The network protocol of the port. Known values are: "TCP" and "UDP". - :vartype protocol: str or ~azure.mgmt.containerservice.models.Protocol - """ - - _validation = { - "port_start": {"maximum": 65535, "minimum": 1}, - "port_end": {"maximum": 65535, "minimum": 1}, - } - - _attribute_map = { - "port_start": {"key": "portStart", "type": "int"}, - "port_end": {"key": "portEnd", "type": "int"}, - "protocol": {"key": "protocol", "type": "str"}, - } - - def __init__( - self, - *, - port_start: Optional[int] = None, - port_end: Optional[int] = None, - protocol: Optional[Union[str, "_models.Protocol"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword port_start: The minimum port that is included in the range. It should be ranged from 1 - to 65535, and be less than or equal to portEnd. - :paramtype port_start: int - :keyword port_end: The maximum port that is included in the range. It should be ranged from 1 - to 65535, and be greater than or equal to portStart. - :paramtype port_end: int - :keyword protocol: The network protocol of the port. Known values are: "TCP" and "UDP". - :paramtype protocol: str or ~azure.mgmt.containerservice.models.Protocol - """ - super().__init__(**kwargs) - self.port_start = port_start - self.port_end = port_end - self.protocol = protocol - - -class PowerState(_serialization.Model): - """Describes the Power State of the cluster. - - :ivar code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and - "Stopped". - :vartype code: str or ~azure.mgmt.containerservice.models.Code - """ - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - } - - def __init__(self, *, code: Optional[Union[str, "_models.Code"]] = None, **kwargs: Any) -> None: - """ - :keyword code: Tells whether the cluster is Running or Stopped. Known values are: "Running" and - "Stopped". - :paramtype code: str or ~azure.mgmt.containerservice.models.Code - """ - super().__init__(**kwargs) - self.code = code - - -class PrivateEndpoint(_serialization.Model): - """Private endpoint which a connection belongs to. - - :ivar id: The resource ID of the private endpoint. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: The resource ID of the private endpoint. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class PrivateEndpointConnection(_serialization.Model): - """A private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private endpoint connection. - :vartype id: str - :ivar name: The name of the private endpoint connection. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar provisioning_state: The current provisioning state. Known values are: "Canceled", - "Creating", "Deleting", "Failed", and "Succeeded". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.models.PrivateEndpointConnectionProvisioningState - :ivar private_endpoint: The resource of private endpoint. - :vartype private_endpoint: ~azure.mgmt.containerservice.models.PrivateEndpoint - :ivar private_link_service_connection_state: A collection of information about the state of the - connection between service consumer and provider. - :vartype private_link_service_connection_state: - ~azure.mgmt.containerservice.models.PrivateLinkServiceConnectionState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpoint"}, - "private_link_service_connection_state": { - "key": "properties.privateLinkServiceConnectionState", - "type": "PrivateLinkServiceConnectionState", - }, - } - - def __init__( - self, - *, - private_endpoint: Optional["_models.PrivateEndpoint"] = None, - private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionState"] = None, - **kwargs: Any - ) -> None: - """ - :keyword private_endpoint: The resource of private endpoint. - :paramtype private_endpoint: ~azure.mgmt.containerservice.models.PrivateEndpoint - :keyword private_link_service_connection_state: A collection of information about the state of - the connection between service consumer and provider. - :paramtype private_link_service_connection_state: - ~azure.mgmt.containerservice.models.PrivateLinkServiceConnectionState - """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - self.provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = None - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - - -class PrivateEndpointConnectionListResult(_serialization.Model): - """A list of private endpoint connections. - - :ivar value: The collection value. - :vartype value: list[~azure.mgmt.containerservice.models.PrivateEndpointConnection] - """ - - _attribute_map = { - "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, - } - - def __init__(self, *, value: Optional[list["_models.PrivateEndpointConnection"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The collection value. - :paramtype value: list[~azure.mgmt.containerservice.models.PrivateEndpointConnection] - """ - super().__init__(**kwargs) - self.value = value - - -class PrivateLinkResource(_serialization.Model): - """A private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ID of the private link resource. - :vartype id: str - :ivar name: The name of the private link resource. - :vartype name: str - :ivar type: The resource type. - :vartype type: str - :ivar group_id: The group ID of the resource. - :vartype group_id: str - :ivar required_members: The RequiredMembers of the resource. - :vartype required_members: list[str] - :ivar private_link_service_id: The private link service ID of the resource, this field is - exposed only to NRP internally. - :vartype private_link_service_id: str - """ - - _validation = { - "private_link_service_id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "group_id": {"key": "groupId", "type": "str"}, - "required_members": {"key": "requiredMembers", "type": "[str]"}, - "private_link_service_id": {"key": "privateLinkServiceID", "type": "str"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - name: Optional[str] = None, - type: Optional[str] = None, - group_id: Optional[str] = None, - required_members: Optional[list[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: The ID of the private link resource. - :paramtype id: str - :keyword name: The name of the private link resource. - :paramtype name: str - :keyword type: The resource type. - :paramtype type: str - :keyword group_id: The group ID of the resource. - :paramtype group_id: str - :keyword required_members: The RequiredMembers of the resource. - :paramtype required_members: list[str] - """ - super().__init__(**kwargs) - self.id = id - self.name = name - self.type = type - self.group_id = group_id - self.required_members = required_members - self.private_link_service_id: Optional[str] = None - - -class PrivateLinkResourcesListResult(_serialization.Model): - """A list of private link resources. - - :ivar value: The collection value. - :vartype value: list[~azure.mgmt.containerservice.models.PrivateLinkResource] - """ - - _attribute_map = { - "value": {"key": "value", "type": "[PrivateLinkResource]"}, - } - - def __init__(self, *, value: Optional[list["_models.PrivateLinkResource"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The collection value. - :paramtype value: list[~azure.mgmt.containerservice.models.PrivateLinkResource] - """ - super().__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(_serialization.Model): - """The state of a private link service connection. - - :ivar status: The private link service connection status. Known values are: "Pending", - "Approved", "Rejected", and "Disconnected". - :vartype status: str or ~azure.mgmt.containerservice.models.ConnectionStatus - :ivar description: The private link service connection description. - :vartype description: str - """ - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "_models.ConnectionStatus"]] = None, - description: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword status: The private link service connection status. Known values are: "Pending", - "Approved", "Rejected", and "Disconnected". - :paramtype status: str or ~azure.mgmt.containerservice.models.ConnectionStatus - :keyword description: The private link service connection description. - :paramtype description: str - """ - super().__init__(**kwargs) - self.status = status - self.description = description - - -class RebalanceLoadBalancersRequestBody(_serialization.Model): - """The names of the load balancers to rebalance. If set to empty, all load balancers will be - rebalanced. - - :ivar load_balancer_names: The load balancer names list. - :vartype load_balancer_names: list[str] - """ - - _attribute_map = { - "load_balancer_names": {"key": "loadBalancerNames", "type": "[str]"}, - } - - def __init__(self, *, load_balancer_names: Optional[list[str]] = None, **kwargs: Any) -> None: - """ - :keyword load_balancer_names: The load balancer names list. - :paramtype load_balancer_names: list[str] - """ - super().__init__(**kwargs) - self.load_balancer_names = load_balancer_names - - -class RelativeMonthlySchedule(_serialization.Model): - """For schedules like: 'recur every month on the first Monday' or 'recur every 3 months on last - Friday'. - - All required parameters must be populated in order to send to server. - - :ivar interval_months: Specifies the number of months between each set of occurrences. - Required. - :vartype interval_months: int - :ivar week_index: The week index. Specifies on which instance of the allowed days specified in - daysOfWeek the maintenance occurs. Required. Known values are: "First", "Second", "Third", - "Fourth", and "Last". - :vartype week_index: str or ~azure.mgmt.containerservice.models.Type - :ivar day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known - values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype day_of_week: str or ~azure.mgmt.containerservice.models.WeekDay - """ - - _validation = { - "interval_months": {"required": True, "maximum": 6, "minimum": 1}, - "week_index": {"required": True}, - "day_of_week": {"required": True}, - } - - _attribute_map = { - "interval_months": {"key": "intervalMonths", "type": "int"}, - "week_index": {"key": "weekIndex", "type": "str"}, - "day_of_week": {"key": "dayOfWeek", "type": "str"}, - } - - def __init__( - self, - *, - interval_months: int, - week_index: Union[str, "_models.Type"], - day_of_week: Union[str, "_models.WeekDay"], - **kwargs: Any - ) -> None: - """ - :keyword interval_months: Specifies the number of months between each set of occurrences. - Required. - :paramtype interval_months: int - :keyword week_index: The week index. Specifies on which instance of the allowed days specified - in daysOfWeek the maintenance occurs. Required. Known values are: "First", "Second", "Third", - "Fourth", and "Last". - :paramtype week_index: str or ~azure.mgmt.containerservice.models.Type - :keyword day_of_week: Specifies on which day of the week the maintenance occurs. Required. - Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and - "Saturday". - :paramtype day_of_week: str or ~azure.mgmt.containerservice.models.WeekDay - """ - super().__init__(**kwargs) - self.interval_months = interval_months - self.week_index = week_index - self.day_of_week = day_of_week - - -class ResourceQuota(_serialization.Model): - """Resource quota for the namespace. - - :ivar cpu_request: CPU request of the namespace in one-thousandth CPU form. See `CPU resource - units - `_ - for more details. - :vartype cpu_request: str - :ivar cpu_limit: CPU limit of the namespace in one-thousandth CPU form. See `CPU resource units - `_ - for more details. - :vartype cpu_limit: str - :ivar memory_request: Memory request of the namespace in the power-of-two equivalents form: Ei, - Pi, Ti, Gi, Mi, Ki. See `Memory resource units - `_ - for more details. - :vartype memory_request: str - :ivar memory_limit: Memory limit of the namespace in the power-of-two equivalents form: Ei, Pi, - Ti, Gi, Mi, Ki. See `Memory resource units - `_ - for more details. - :vartype memory_limit: str - """ - - _attribute_map = { - "cpu_request": {"key": "cpuRequest", "type": "str"}, - "cpu_limit": {"key": "cpuLimit", "type": "str"}, - "memory_request": {"key": "memoryRequest", "type": "str"}, - "memory_limit": {"key": "memoryLimit", "type": "str"}, - } - - def __init__( - self, - *, - cpu_request: Optional[str] = None, - cpu_limit: Optional[str] = None, - memory_request: Optional[str] = None, - memory_limit: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword cpu_request: CPU request of the namespace in one-thousandth CPU form. See `CPU - resource units - `_ - for more details. - :paramtype cpu_request: str - :keyword cpu_limit: CPU limit of the namespace in one-thousandth CPU form. See `CPU resource - units - `_ - for more details. - :paramtype cpu_limit: str - :keyword memory_request: Memory request of the namespace in the power-of-two equivalents form: - Ei, Pi, Ti, Gi, Mi, Ki. See `Memory resource units - `_ - for more details. - :paramtype memory_request: str - :keyword memory_limit: Memory limit of the namespace in the power-of-two equivalents form: Ei, - Pi, Ti, Gi, Mi, Ki. See `Memory resource units - `_ - for more details. - :paramtype memory_limit: str - """ - super().__init__(**kwargs) - self.cpu_request = cpu_request - self.cpu_limit = cpu_limit - self.memory_request = memory_request - self.memory_limit = memory_limit - - -class ResourceReference(_serialization.Model): - """A reference to an Azure resource. - - :ivar id: The fully qualified Azure resource id. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: The fully qualified Azure resource id. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class RunCommandRequest(_serialization.Model): - """A run command request. - - All required parameters must be populated in order to send to server. - - :ivar command: The command to run. Required. - :vartype command: str - :ivar context: A base64 encoded zip file containing the files required by the command. - :vartype context: str - :ivar cluster_token: AuthToken issued for AKS AAD Server App. - :vartype cluster_token: str - """ - - _validation = { - "command": {"required": True}, - } - - _attribute_map = { - "command": {"key": "command", "type": "str"}, - "context": {"key": "context", "type": "str"}, - "cluster_token": {"key": "clusterToken", "type": "str"}, - } - - def __init__( - self, *, command: str, context: Optional[str] = None, cluster_token: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword command: The command to run. Required. - :paramtype command: str - :keyword context: A base64 encoded zip file containing the files required by the command. - :paramtype context: str - :keyword cluster_token: AuthToken issued for AKS AAD Server App. - :paramtype cluster_token: str - """ - super().__init__(**kwargs) - self.command = command - self.context = context - self.cluster_token = cluster_token - - -class RunCommandResult(_serialization.Model): - """run command result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The command id. - :vartype id: str - :ivar provisioning_state: provisioning State. - :vartype provisioning_state: str - :ivar exit_code: The exit code of the command. - :vartype exit_code: int - :ivar started_at: The time when the command started. - :vartype started_at: ~datetime.datetime - :ivar finished_at: The time when the command finished. - :vartype finished_at: ~datetime.datetime - :ivar logs: The command output. - :vartype logs: str - :ivar reason: An explanation of why provisioningState is set to failed (if so). - :vartype reason: str - """ - - _validation = { - "id": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "exit_code": {"readonly": True}, - "started_at": {"readonly": True}, - "finished_at": {"readonly": True}, - "logs": {"readonly": True}, - "reason": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "exit_code": {"key": "properties.exitCode", "type": "int"}, - "started_at": {"key": "properties.startedAt", "type": "iso-8601"}, - "finished_at": {"key": "properties.finishedAt", "type": "iso-8601"}, - "logs": {"key": "properties.logs", "type": "str"}, - "reason": {"key": "properties.reason", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.provisioning_state: Optional[str] = None - self.exit_code: Optional[int] = None - self.started_at: Optional[datetime.datetime] = None - self.finished_at: Optional[datetime.datetime] = None - self.logs: Optional[str] = None - self.reason: Optional[str] = None - - -class SafeguardsAvailableVersion(Resource): - """Available Safeguards Version. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - :ivar properties: Whether the version is default or not and support info. Required. - :vartype properties: ~azure.mgmt.containerservice.models.SafeguardsAvailableVersionsProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "properties": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "SafeguardsAvailableVersionsProperties"}, - } - - def __init__(self, *, properties: "_models.SafeguardsAvailableVersionsProperties", **kwargs: Any) -> None: - """ - :keyword properties: Whether the version is default or not and support info. Required. - :paramtype properties: - ~azure.mgmt.containerservice.models.SafeguardsAvailableVersionsProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class SafeguardsAvailableVersionsList(_serialization.Model): - """Hold values properties, which is array of SafeguardsVersions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of AKS supported Safeguards versions. - :vartype value: list[~azure.mgmt.containerservice.models.SafeguardsAvailableVersion] - :ivar next_link: The URL to get the next Safeguards available version. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SafeguardsAvailableVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.SafeguardsAvailableVersion"]] = None, **kwargs: Any) -> None: - """ - :keyword value: Array of AKS supported Safeguards versions. - :paramtype value: list[~azure.mgmt.containerservice.models.SafeguardsAvailableVersion] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class SafeguardsAvailableVersionsProperties(_serialization.Model): - """Whether the version is default or not and support info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar is_default_version: - :vartype is_default_version: bool - :ivar support: Whether the version is preview or stable. Known values are: "Preview" and - "Stable". - :vartype support: str or ~azure.mgmt.containerservice.models.SafeguardsSupport - """ - - _validation = { - "is_default_version": {"readonly": True}, - "support": {"readonly": True}, - } - - _attribute_map = { - "is_default_version": {"key": "isDefaultVersion", "type": "bool"}, - "support": {"key": "support", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.is_default_version: Optional[bool] = None - self.support: Optional[Union[str, "_models.SafeguardsSupport"]] = None - - -class ScaleProfile(_serialization.Model): - """Specifications on how to scale a VirtualMachines agent pool. - - :ivar manual: Specifications on how to scale the VirtualMachines agent pool to a fixed size. - :vartype manual: list[~azure.mgmt.containerservice.models.ManualScaleProfile] - :ivar autoscale: Specifications on how to auto-scale the VirtualMachines agent pool within a - predefined size range. - :vartype autoscale: ~azure.mgmt.containerservice.models.AutoScaleProfile - """ - - _attribute_map = { - "manual": {"key": "manual", "type": "[ManualScaleProfile]"}, - "autoscale": {"key": "autoscale", "type": "AutoScaleProfile"}, - } - - def __init__( - self, - *, - manual: Optional[list["_models.ManualScaleProfile"]] = None, - autoscale: Optional["_models.AutoScaleProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword manual: Specifications on how to scale the VirtualMachines agent pool to a fixed size. - :paramtype manual: list[~azure.mgmt.containerservice.models.ManualScaleProfile] - :keyword autoscale: Specifications on how to auto-scale the VirtualMachines agent pool within a - predefined size range. - :paramtype autoscale: ~azure.mgmt.containerservice.models.AutoScaleProfile - """ - super().__init__(**kwargs) - self.manual = manual - self.autoscale = autoscale - - -class Schedule(_serialization.Model): - """One and only one of the schedule types should be specified. Choose either 'daily', 'weekly', - 'absoluteMonthly' or 'relativeMonthly' for your maintenance schedule. - - :ivar daily: For schedules like: 'recur every day' or 'recur every 3 days'. - :vartype daily: ~azure.mgmt.containerservice.models.DailySchedule - :ivar weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - :vartype weekly: ~azure.mgmt.containerservice.models.WeeklySchedule - :ivar absolute_monthly: For schedules like: 'recur every month on the 15th' or 'recur every 3 - months on the 20th'. - :vartype absolute_monthly: ~azure.mgmt.containerservice.models.AbsoluteMonthlySchedule - :ivar relative_monthly: For schedules like: 'recur every month on the first Monday' or 'recur - every 3 months on last Friday'. - :vartype relative_monthly: ~azure.mgmt.containerservice.models.RelativeMonthlySchedule - """ - - _attribute_map = { - "daily": {"key": "daily", "type": "DailySchedule"}, - "weekly": {"key": "weekly", "type": "WeeklySchedule"}, - "absolute_monthly": {"key": "absoluteMonthly", "type": "AbsoluteMonthlySchedule"}, - "relative_monthly": {"key": "relativeMonthly", "type": "RelativeMonthlySchedule"}, - } - - def __init__( - self, - *, - daily: Optional["_models.DailySchedule"] = None, - weekly: Optional["_models.WeeklySchedule"] = None, - absolute_monthly: Optional["_models.AbsoluteMonthlySchedule"] = None, - relative_monthly: Optional["_models.RelativeMonthlySchedule"] = None, - **kwargs: Any - ) -> None: - """ - :keyword daily: For schedules like: 'recur every day' or 'recur every 3 days'. - :paramtype daily: ~azure.mgmt.containerservice.models.DailySchedule - :keyword weekly: For schedules like: 'recur every Monday' or 'recur every 3 weeks on - Wednesday'. - :paramtype weekly: ~azure.mgmt.containerservice.models.WeeklySchedule - :keyword absolute_monthly: For schedules like: 'recur every month on the 15th' or 'recur every - 3 months on the 20th'. - :paramtype absolute_monthly: ~azure.mgmt.containerservice.models.AbsoluteMonthlySchedule - :keyword relative_monthly: For schedules like: 'recur every month on the first Monday' or - 'recur every 3 months on last Friday'. - :paramtype relative_monthly: ~azure.mgmt.containerservice.models.RelativeMonthlySchedule - """ - super().__init__(**kwargs) - self.daily = daily - self.weekly = weekly - self.absolute_monthly = absolute_monthly - self.relative_monthly = relative_monthly - - -class SchedulerInstanceProfile(_serialization.Model): - """The scheduler profile for a single scheduler instance. - - :ivar scheduler_config_mode: The config customization mode for this scheduler instance. Known - values are: "Default" and "ManagedByCRD". - :vartype scheduler_config_mode: str or ~azure.mgmt.containerservice.models.SchedulerConfigMode - """ - - _attribute_map = { - "scheduler_config_mode": {"key": "schedulerConfigMode", "type": "str"}, - } - - def __init__( - self, *, scheduler_config_mode: Optional[Union[str, "_models.SchedulerConfigMode"]] = None, **kwargs: Any - ) -> None: - """ - :keyword scheduler_config_mode: The config customization mode for this scheduler instance. - Known values are: "Default" and "ManagedByCRD". - :paramtype scheduler_config_mode: str or - ~azure.mgmt.containerservice.models.SchedulerConfigMode - """ - super().__init__(**kwargs) - self.scheduler_config_mode = scheduler_config_mode - - -class SchedulerProfile(_serialization.Model): - """The pod scheduler profile for the cluster. - - :ivar scheduler_instance_profiles: Mapping of each scheduler instance to its profile. - :vartype scheduler_instance_profiles: - ~azure.mgmt.containerservice.models.SchedulerProfileSchedulerInstanceProfiles - """ - - _attribute_map = { - "scheduler_instance_profiles": { - "key": "schedulerInstanceProfiles", - "type": "SchedulerProfileSchedulerInstanceProfiles", - }, - } - - def __init__( - self, - *, - scheduler_instance_profiles: Optional["_models.SchedulerProfileSchedulerInstanceProfiles"] = None, - **kwargs: Any - ) -> None: - """ - :keyword scheduler_instance_profiles: Mapping of each scheduler instance to its profile. - :paramtype scheduler_instance_profiles: - ~azure.mgmt.containerservice.models.SchedulerProfileSchedulerInstanceProfiles - """ - super().__init__(**kwargs) - self.scheduler_instance_profiles = scheduler_instance_profiles - - -class SchedulerProfileSchedulerInstanceProfiles(_serialization.Model): # pylint: disable=name-too-long - """Mapping of each scheduler instance to its profile. - - :ivar upstream: The scheduler profile for the upstream scheduler instance. - :vartype upstream: ~azure.mgmt.containerservice.models.SchedulerInstanceProfile - """ - - _attribute_map = { - "upstream": {"key": "upstream", "type": "SchedulerInstanceProfile"}, - } - - def __init__(self, *, upstream: Optional["_models.SchedulerInstanceProfile"] = None, **kwargs: Any) -> None: - """ - :keyword upstream: The scheduler profile for the upstream scheduler instance. - :paramtype upstream: ~azure.mgmt.containerservice.models.SchedulerInstanceProfile - """ - super().__init__(**kwargs) - self.upstream = upstream - - -class ServiceMeshProfile(_serialization.Model): - """Service mesh profile for a managed cluster. - - All required parameters must be populated in order to send to server. - - :ivar mode: Mode of the service mesh. Required. Known values are: "Istio" and "Disabled". - :vartype mode: str or ~azure.mgmt.containerservice.models.ServiceMeshMode - :ivar istio: Istio service mesh configuration. - :vartype istio: ~azure.mgmt.containerservice.models.IstioServiceMesh - """ - - _validation = { - "mode": {"required": True}, - } - - _attribute_map = { - "mode": {"key": "mode", "type": "str"}, - "istio": {"key": "istio", "type": "IstioServiceMesh"}, - } - - def __init__( - self, - *, - mode: Union[str, "_models.ServiceMeshMode"], - istio: Optional["_models.IstioServiceMesh"] = None, - **kwargs: Any - ) -> None: - """ - :keyword mode: Mode of the service mesh. Required. Known values are: "Istio" and "Disabled". - :paramtype mode: str or ~azure.mgmt.containerservice.models.ServiceMeshMode - :keyword istio: Istio service mesh configuration. - :paramtype istio: ~azure.mgmt.containerservice.models.IstioServiceMesh - """ - super().__init__(**kwargs) - self.mode = mode - self.istio = istio - - -class Snapshot(TrackedResource): - """A node pool snapshot resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str - :ivar creation_data: CreationData to be used to specify the source agent pool resource ID to - create this snapshot. - :vartype creation_data: ~azure.mgmt.containerservice.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.models.SnapshotType - :ivar kubernetes_version: The version of Kubernetes. - :vartype kubernetes_version: str - :ivar node_image_version: The version of node image. - :vartype node_image_version: str - :ivar os_type: The operating system type. The default is Linux. Known values are: "Linux" and - "Windows". - :vartype os_type: str or ~azure.mgmt.containerservice.models.OSType - :ivar os_sku: Specifies the OS SKU used by the agent pool. If not specified, the default is - Ubuntu if OSType=Linux or Windows2019 if OSType=Windows. And the default Windows OSSKU will be - changed to Windows2022 after Windows2019 is deprecated. Known values are: "Ubuntu", "Mariner", - "AzureLinux", "AzureLinux3", "Flatcar", "CBLMariner", "Windows2019", "Windows2022", - "Windows2025", "WindowsAnnual", "Ubuntu2204", and "Ubuntu2404". - :vartype os_sku: str or ~azure.mgmt.containerservice.models.OSSKU - :ivar vm_size: The size of the VM. - :vartype vm_size: str - :ivar enable_fips: Whether to use a FIPS-enabled OS. - :vartype enable_fips: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, - "kubernetes_version": {"readonly": True}, - "node_image_version": {"readonly": True}, - "os_type": {"readonly": True}, - "os_sku": {"readonly": True}, - "vm_size": {"readonly": True}, - "enable_fips": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, - "creation_data": {"key": "properties.creationData", "type": "CreationData"}, - "snapshot_type": {"key": "properties.snapshotType", "type": "str"}, - "kubernetes_version": {"key": "properties.kubernetesVersion", "type": "str"}, - "node_image_version": {"key": "properties.nodeImageVersion", "type": "str"}, - "os_type": {"key": "properties.osType", "type": "str"}, - "os_sku": {"key": "properties.osSku", "type": "str"}, - "vm_size": {"key": "properties.vmSize", "type": "str"}, - "enable_fips": {"key": "properties.enableFIPS", "type": "bool"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - creation_data: Optional["_models.CreationData"] = None, - snapshot_type: Union[str, "_models.SnapshotType"] = "NodePool", - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str - :keyword creation_data: CreationData to be used to specify the source agent pool resource ID to - create this snapshot. - :paramtype creation_data: ~azure.mgmt.containerservice.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.models.SnapshotType - """ - super().__init__(tags=tags, location=location, **kwargs) - self.creation_data = creation_data - self.snapshot_type = snapshot_type - self.kubernetes_version: Optional[str] = None - self.node_image_version: Optional[str] = None - self.os_type: Optional[Union[str, "_models.OSType"]] = None - self.os_sku: Optional[Union[str, "_models.OSSKU"]] = None - self.vm_size: Optional[str] = None - self.enable_fips: Optional[bool] = None - - -class SnapshotListResult(_serialization.Model): - """The response from the List Snapshots operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The list of snapshots. - :vartype value: list[~azure.mgmt.containerservice.models.Snapshot] - :ivar next_link: The URL to get the next set of snapshot results. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Snapshot]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.Snapshot"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of snapshots. - :paramtype value: list[~azure.mgmt.containerservice.models.Snapshot] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = None - - -class SysctlConfig(_serialization.Model): - """Sysctl settings for Linux agent nodes. - - :ivar net_core_somaxconn: Sysctl setting net.core.somaxconn. - :vartype net_core_somaxconn: int - :ivar net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :vartype net_core_netdev_max_backlog: int - :ivar net_core_rmem_default: Sysctl setting net.core.rmem_default. - :vartype net_core_rmem_default: int - :ivar net_core_rmem_max: Sysctl setting net.core.rmem_max. - :vartype net_core_rmem_max: int - :ivar net_core_wmem_default: Sysctl setting net.core.wmem_default. - :vartype net_core_wmem_default: int - :ivar net_core_wmem_max: Sysctl setting net.core.wmem_max. - :vartype net_core_wmem_max: int - :ivar net_core_optmem_max: Sysctl setting net.core.optmem_max. - :vartype net_core_optmem_max: int - :ivar net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :vartype net_ipv4_tcp_max_syn_backlog: int - :ivar net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :vartype net_ipv4_tcp_max_tw_buckets: int - :ivar net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :vartype net_ipv4_tcp_fin_timeout: int - :ivar net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :vartype net_ipv4_tcp_keepalive_time: int - :ivar net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :vartype net_ipv4_tcp_keepalive_probes: int - :ivar net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :vartype net_ipv4_tcpkeepalive_intvl: int - :ivar net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :vartype net_ipv4_tcp_tw_reuse: bool - :ivar net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :vartype net_ipv4_ip_local_port_range: str - :ivar net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :vartype net_ipv4_neigh_default_gc_thresh1: int - :ivar net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :vartype net_ipv4_neigh_default_gc_thresh2: int - :ivar net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :vartype net_ipv4_neigh_default_gc_thresh3: int - :ivar net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :vartype net_netfilter_nf_conntrack_max: int - :ivar net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :vartype net_netfilter_nf_conntrack_buckets: int - :ivar fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :vartype fs_inotify_max_user_watches: int - :ivar fs_file_max: Sysctl setting fs.file-max. - :vartype fs_file_max: int - :ivar fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :vartype fs_aio_max_nr: int - :ivar fs_nr_open: Sysctl setting fs.nr_open. - :vartype fs_nr_open: int - :ivar kernel_threads_max: Sysctl setting kernel.threads-max. - :vartype kernel_threads_max: int - :ivar vm_max_map_count: Sysctl setting vm.max_map_count. - :vartype vm_max_map_count: int - :ivar vm_swappiness: Sysctl setting vm.swappiness. - :vartype vm_swappiness: int - :ivar vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :vartype vm_vfs_cache_pressure: int - """ - - _validation = { - "net_ipv4_tcpkeepalive_intvl": {"maximum": 90, "minimum": 10}, - "net_netfilter_nf_conntrack_max": {"maximum": 2097152, "minimum": 131072}, - "net_netfilter_nf_conntrack_buckets": {"maximum": 524288, "minimum": 65536}, - } - - _attribute_map = { - "net_core_somaxconn": {"key": "netCoreSomaxconn", "type": "int"}, - "net_core_netdev_max_backlog": {"key": "netCoreNetdevMaxBacklog", "type": "int"}, - "net_core_rmem_default": {"key": "netCoreRmemDefault", "type": "int"}, - "net_core_rmem_max": {"key": "netCoreRmemMax", "type": "int"}, - "net_core_wmem_default": {"key": "netCoreWmemDefault", "type": "int"}, - "net_core_wmem_max": {"key": "netCoreWmemMax", "type": "int"}, - "net_core_optmem_max": {"key": "netCoreOptmemMax", "type": "int"}, - "net_ipv4_tcp_max_syn_backlog": {"key": "netIpv4TcpMaxSynBacklog", "type": "int"}, - "net_ipv4_tcp_max_tw_buckets": {"key": "netIpv4TcpMaxTwBuckets", "type": "int"}, - "net_ipv4_tcp_fin_timeout": {"key": "netIpv4TcpFinTimeout", "type": "int"}, - "net_ipv4_tcp_keepalive_time": {"key": "netIpv4TcpKeepaliveTime", "type": "int"}, - "net_ipv4_tcp_keepalive_probes": {"key": "netIpv4TcpKeepaliveProbes", "type": "int"}, - "net_ipv4_tcpkeepalive_intvl": {"key": "netIpv4TcpkeepaliveIntvl", "type": "int"}, - "net_ipv4_tcp_tw_reuse": {"key": "netIpv4TcpTwReuse", "type": "bool"}, - "net_ipv4_ip_local_port_range": {"key": "netIpv4IpLocalPortRange", "type": "str"}, - "net_ipv4_neigh_default_gc_thresh1": {"key": "netIpv4NeighDefaultGcThresh1", "type": "int"}, - "net_ipv4_neigh_default_gc_thresh2": {"key": "netIpv4NeighDefaultGcThresh2", "type": "int"}, - "net_ipv4_neigh_default_gc_thresh3": {"key": "netIpv4NeighDefaultGcThresh3", "type": "int"}, - "net_netfilter_nf_conntrack_max": {"key": "netNetfilterNfConntrackMax", "type": "int"}, - "net_netfilter_nf_conntrack_buckets": {"key": "netNetfilterNfConntrackBuckets", "type": "int"}, - "fs_inotify_max_user_watches": {"key": "fsInotifyMaxUserWatches", "type": "int"}, - "fs_file_max": {"key": "fsFileMax", "type": "int"}, - "fs_aio_max_nr": {"key": "fsAioMaxNr", "type": "int"}, - "fs_nr_open": {"key": "fsNrOpen", "type": "int"}, - "kernel_threads_max": {"key": "kernelThreadsMax", "type": "int"}, - "vm_max_map_count": {"key": "vmMaxMapCount", "type": "int"}, - "vm_swappiness": {"key": "vmSwappiness", "type": "int"}, - "vm_vfs_cache_pressure": {"key": "vmVfsCachePressure", "type": "int"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - net_core_somaxconn: Optional[int] = None, - net_core_netdev_max_backlog: Optional[int] = None, - net_core_rmem_default: Optional[int] = None, - net_core_rmem_max: Optional[int] = None, - net_core_wmem_default: Optional[int] = None, - net_core_wmem_max: Optional[int] = None, - net_core_optmem_max: Optional[int] = None, - net_ipv4_tcp_max_syn_backlog: Optional[int] = None, - net_ipv4_tcp_max_tw_buckets: Optional[int] = None, - net_ipv4_tcp_fin_timeout: Optional[int] = None, - net_ipv4_tcp_keepalive_time: Optional[int] = None, - net_ipv4_tcp_keepalive_probes: Optional[int] = None, - net_ipv4_tcpkeepalive_intvl: Optional[int] = None, - net_ipv4_tcp_tw_reuse: Optional[bool] = None, - net_ipv4_ip_local_port_range: Optional[str] = None, - net_ipv4_neigh_default_gc_thresh1: Optional[int] = None, - net_ipv4_neigh_default_gc_thresh2: Optional[int] = None, - net_ipv4_neigh_default_gc_thresh3: Optional[int] = None, - net_netfilter_nf_conntrack_max: Optional[int] = None, - net_netfilter_nf_conntrack_buckets: Optional[int] = None, - fs_inotify_max_user_watches: Optional[int] = None, - fs_file_max: Optional[int] = None, - fs_aio_max_nr: Optional[int] = None, - fs_nr_open: Optional[int] = None, - kernel_threads_max: Optional[int] = None, - vm_max_map_count: Optional[int] = None, - vm_swappiness: Optional[int] = None, - vm_vfs_cache_pressure: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword net_core_somaxconn: Sysctl setting net.core.somaxconn. - :paramtype net_core_somaxconn: int - :keyword net_core_netdev_max_backlog: Sysctl setting net.core.netdev_max_backlog. - :paramtype net_core_netdev_max_backlog: int - :keyword net_core_rmem_default: Sysctl setting net.core.rmem_default. - :paramtype net_core_rmem_default: int - :keyword net_core_rmem_max: Sysctl setting net.core.rmem_max. - :paramtype net_core_rmem_max: int - :keyword net_core_wmem_default: Sysctl setting net.core.wmem_default. - :paramtype net_core_wmem_default: int - :keyword net_core_wmem_max: Sysctl setting net.core.wmem_max. - :paramtype net_core_wmem_max: int - :keyword net_core_optmem_max: Sysctl setting net.core.optmem_max. - :paramtype net_core_optmem_max: int - :keyword net_ipv4_tcp_max_syn_backlog: Sysctl setting net.ipv4.tcp_max_syn_backlog. - :paramtype net_ipv4_tcp_max_syn_backlog: int - :keyword net_ipv4_tcp_max_tw_buckets: Sysctl setting net.ipv4.tcp_max_tw_buckets. - :paramtype net_ipv4_tcp_max_tw_buckets: int - :keyword net_ipv4_tcp_fin_timeout: Sysctl setting net.ipv4.tcp_fin_timeout. - :paramtype net_ipv4_tcp_fin_timeout: int - :keyword net_ipv4_tcp_keepalive_time: Sysctl setting net.ipv4.tcp_keepalive_time. - :paramtype net_ipv4_tcp_keepalive_time: int - :keyword net_ipv4_tcp_keepalive_probes: Sysctl setting net.ipv4.tcp_keepalive_probes. - :paramtype net_ipv4_tcp_keepalive_probes: int - :keyword net_ipv4_tcpkeepalive_intvl: Sysctl setting net.ipv4.tcp_keepalive_intvl. - :paramtype net_ipv4_tcpkeepalive_intvl: int - :keyword net_ipv4_tcp_tw_reuse: Sysctl setting net.ipv4.tcp_tw_reuse. - :paramtype net_ipv4_tcp_tw_reuse: bool - :keyword net_ipv4_ip_local_port_range: Sysctl setting net.ipv4.ip_local_port_range. - :paramtype net_ipv4_ip_local_port_range: str - :keyword net_ipv4_neigh_default_gc_thresh1: Sysctl setting net.ipv4.neigh.default.gc_thresh1. - :paramtype net_ipv4_neigh_default_gc_thresh1: int - :keyword net_ipv4_neigh_default_gc_thresh2: Sysctl setting net.ipv4.neigh.default.gc_thresh2. - :paramtype net_ipv4_neigh_default_gc_thresh2: int - :keyword net_ipv4_neigh_default_gc_thresh3: Sysctl setting net.ipv4.neigh.default.gc_thresh3. - :paramtype net_ipv4_neigh_default_gc_thresh3: int - :keyword net_netfilter_nf_conntrack_max: Sysctl setting net.netfilter.nf_conntrack_max. - :paramtype net_netfilter_nf_conntrack_max: int - :keyword net_netfilter_nf_conntrack_buckets: Sysctl setting net.netfilter.nf_conntrack_buckets. - :paramtype net_netfilter_nf_conntrack_buckets: int - :keyword fs_inotify_max_user_watches: Sysctl setting fs.inotify.max_user_watches. - :paramtype fs_inotify_max_user_watches: int - :keyword fs_file_max: Sysctl setting fs.file-max. - :paramtype fs_file_max: int - :keyword fs_aio_max_nr: Sysctl setting fs.aio-max-nr. - :paramtype fs_aio_max_nr: int - :keyword fs_nr_open: Sysctl setting fs.nr_open. - :paramtype fs_nr_open: int - :keyword kernel_threads_max: Sysctl setting kernel.threads-max. - :paramtype kernel_threads_max: int - :keyword vm_max_map_count: Sysctl setting vm.max_map_count. - :paramtype vm_max_map_count: int - :keyword vm_swappiness: Sysctl setting vm.swappiness. - :paramtype vm_swappiness: int - :keyword vm_vfs_cache_pressure: Sysctl setting vm.vfs_cache_pressure. - :paramtype vm_vfs_cache_pressure: int - """ - super().__init__(**kwargs) - self.net_core_somaxconn = net_core_somaxconn - self.net_core_netdev_max_backlog = net_core_netdev_max_backlog - self.net_core_rmem_default = net_core_rmem_default - self.net_core_rmem_max = net_core_rmem_max - self.net_core_wmem_default = net_core_wmem_default - self.net_core_wmem_max = net_core_wmem_max - self.net_core_optmem_max = net_core_optmem_max - self.net_ipv4_tcp_max_syn_backlog = net_ipv4_tcp_max_syn_backlog - self.net_ipv4_tcp_max_tw_buckets = net_ipv4_tcp_max_tw_buckets - self.net_ipv4_tcp_fin_timeout = net_ipv4_tcp_fin_timeout - self.net_ipv4_tcp_keepalive_time = net_ipv4_tcp_keepalive_time - self.net_ipv4_tcp_keepalive_probes = net_ipv4_tcp_keepalive_probes - self.net_ipv4_tcpkeepalive_intvl = net_ipv4_tcpkeepalive_intvl - self.net_ipv4_tcp_tw_reuse = net_ipv4_tcp_tw_reuse - self.net_ipv4_ip_local_port_range = net_ipv4_ip_local_port_range - self.net_ipv4_neigh_default_gc_thresh1 = net_ipv4_neigh_default_gc_thresh1 - self.net_ipv4_neigh_default_gc_thresh2 = net_ipv4_neigh_default_gc_thresh2 - self.net_ipv4_neigh_default_gc_thresh3 = net_ipv4_neigh_default_gc_thresh3 - self.net_netfilter_nf_conntrack_max = net_netfilter_nf_conntrack_max - self.net_netfilter_nf_conntrack_buckets = net_netfilter_nf_conntrack_buckets - self.fs_inotify_max_user_watches = fs_inotify_max_user_watches - self.fs_file_max = fs_file_max - self.fs_aio_max_nr = fs_aio_max_nr - self.fs_nr_open = fs_nr_open - self.kernel_threads_max = kernel_threads_max - self.vm_max_map_count = vm_max_map_count - self.vm_swappiness = vm_swappiness - self.vm_vfs_cache_pressure = vm_vfs_cache_pressure - - -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.containerservice.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.containerservice.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.containerservice.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or ~azure.mgmt.containerservice.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TagsObject(_serialization.Model): - """Tags object for patch operations. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, tags: Optional[dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.tags = tags - - -class TimeInWeek(_serialization.Model): - """Time in a week. - - :ivar day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", and "Saturday". - :vartype day: str or ~azure.mgmt.containerservice.models.WeekDay - :ivar hour_slots: A list of hours in the day used to identify a time range. Each integer hour - represents a time range beginning at 0m after the hour ending at the next hour (non-inclusive). - 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] means the 00:00 - - 02:00 UTC time range. - :vartype hour_slots: list[int] - """ - - _attribute_map = { - "day": {"key": "day", "type": "str"}, - "hour_slots": {"key": "hourSlots", "type": "[int]"}, - } - - def __init__( - self, - *, - day: Optional[Union[str, "_models.WeekDay"]] = None, - hour_slots: Optional[list[int]] = None, - **kwargs: Any - ) -> None: - """ - :keyword day: The day of the week. Known values are: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", and "Saturday". - :paramtype day: str or ~azure.mgmt.containerservice.models.WeekDay - :keyword hour_slots: A list of hours in the day used to identify a time range. Each integer - hour represents a time range beginning at 0m after the hour ending at the next hour - (non-inclusive). 0 corresponds to 00:00 UTC, 23 corresponds to 23:00 UTC. Specifying [0, 1] - means the 00:00 - 02:00 UTC time range. - :paramtype hour_slots: list[int] - """ - super().__init__(**kwargs) - self.day = day - self.hour_slots = hour_slots - - -class TimeSpan(_serialization.Model): - """A time range. For example, between 2021-05-25T13:00:00Z and 2021-05-25T14:00:00Z. - - :ivar start: The start of a time span. - :vartype start: ~datetime.datetime - :ivar end: The end of a time span. - :vartype end: ~datetime.datetime - """ - - _attribute_map = { - "start": {"key": "start", "type": "iso-8601"}, - "end": {"key": "end", "type": "iso-8601"}, - } - - def __init__( - self, *, start: Optional[datetime.datetime] = None, end: Optional[datetime.datetime] = None, **kwargs: Any - ) -> None: - """ - :keyword start: The start of a time span. - :paramtype start: ~datetime.datetime - :keyword end: The end of a time span. - :paramtype end: ~datetime.datetime - """ - super().__init__(**kwargs) - self.start = start - self.end = end - - -class TrustedAccessRole(_serialization.Model): - """Trusted access role definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar source_resource_type: Resource type of Azure resource. - :vartype source_resource_type: str - :ivar name: Name of role, name is unique under a source resource type. - :vartype name: str - :ivar rules: List of rules for the role. This maps to 'rules' property of `Kubernetes Cluster - Role - `_. - :vartype rules: list[~azure.mgmt.containerservice.models.TrustedAccessRoleRule] - """ - - _validation = { - "source_resource_type": {"readonly": True}, - "name": {"readonly": True}, - "rules": {"readonly": True}, - } - - _attribute_map = { - "source_resource_type": {"key": "sourceResourceType", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "rules": {"key": "rules", "type": "[TrustedAccessRoleRule]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.source_resource_type: Optional[str] = None - self.name: Optional[str] = None - self.rules: Optional[list["_models.TrustedAccessRoleRule"]] = None - - -class TrustedAccessRoleBinding(Resource): - """Defines binding between a resource and role. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". - :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.models.SystemData - :ivar provisioning_state: The current provisioning state of trusted access role binding. Known - values are: "Canceled", "Deleting", "Failed", "Succeeded", and "Updating". - :vartype provisioning_state: str or - ~azure.mgmt.containerservice.models.TrustedAccessRoleBindingProvisioningState - :ivar source_resource_id: The ARM resource ID of source resource that trusted access is - configured for. Required. - :vartype source_resource_id: str - :ivar roles: A list of roles to bind, each item is a resource type qualified role name. For - example: 'Microsoft.MachineLearningServices/workspaces/reader'. Required. - :vartype roles: list[str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "source_resource_id": {"required": True}, - "roles": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "source_resource_id": {"key": "properties.sourceResourceId", "type": "str"}, - "roles": {"key": "properties.roles", "type": "[str]"}, - } - - def __init__(self, *, source_resource_id: str, roles: list[str], **kwargs: Any) -> None: - """ - :keyword source_resource_id: The ARM resource ID of source resource that trusted access is - configured for. Required. - :paramtype source_resource_id: str - :keyword roles: A list of roles to bind, each item is a resource type qualified role name. For - example: 'Microsoft.MachineLearningServices/workspaces/reader'. Required. - :paramtype roles: list[str] - """ - super().__init__(**kwargs) - self.provisioning_state: Optional[Union[str, "_models.TrustedAccessRoleBindingProvisioningState"]] = 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.models.TrustedAccessRoleBinding] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[TrustedAccessRoleBinding]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, *, value: Optional[list["_models.TrustedAccessRoleBinding"]] = None, **kwargs: Any) -> None: - """ - :keyword value: Role binding list. - :paramtype value: list[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] - """ - super().__init__(**kwargs) - self.value = value - self.next_link: Optional[str] = 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.models.TrustedAccessRole] - :ivar next_link: Link to next page of resources. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[TrustedAccessRole]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.TrustedAccessRole"]] = None - self.next_link: Optional[str] = None - - -class TrustedAccessRoleRule(_serialization.Model): - """Rule for trusted access role. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar verbs: List of allowed verbs. - :vartype verbs: list[str] - :ivar api_groups: List of allowed apiGroups. - :vartype api_groups: list[str] - :ivar resources: List of allowed resources. - :vartype resources: list[str] - :ivar resource_names: List of allowed names. - :vartype resource_names: list[str] - :ivar non_resource_ur_ls: List of allowed nonResourceURLs. - :vartype non_resource_ur_ls: list[str] - """ - - _validation = { - "verbs": {"readonly": True}, - "api_groups": {"readonly": True}, - "resources": {"readonly": True}, - "resource_names": {"readonly": True}, - "non_resource_ur_ls": {"readonly": True}, - } - - _attribute_map = { - "verbs": {"key": "verbs", "type": "[str]"}, - "api_groups": {"key": "apiGroups", "type": "[str]"}, - "resources": {"key": "resources", "type": "[str]"}, - "resource_names": {"key": "resourceNames", "type": "[str]"}, - "non_resource_ur_ls": {"key": "nonResourceURLs", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.verbs: Optional[list[str]] = None - self.api_groups: Optional[list[str]] = None - self.resources: Optional[list[str]] = None - self.resource_names: Optional[list[str]] = None - self.non_resource_ur_ls: Optional[list[str]] = None - - -class UpgradeOverrideSettings(_serialization.Model): - """Settings for overrides when upgrading a cluster. - - :ivar force_upgrade: Whether to force upgrade the cluster. Note that this option instructs - upgrade operation to bypass upgrade protections such as checking for deprecated API usage. - Enable this option only with caution. - :vartype force_upgrade: bool - :ivar until: Until when the overrides are effective. Note that this only matches the start time - of an upgrade, and the effectiveness won't change once an upgrade starts even if the ``until`` - expires as upgrade proceeds. This field is not set by default. It must be set for the overrides - to take effect. - :vartype until: ~datetime.datetime - """ - - _attribute_map = { - "force_upgrade": {"key": "forceUpgrade", "type": "bool"}, - "until": {"key": "until", "type": "iso-8601"}, - } - - def __init__( - self, *, force_upgrade: Optional[bool] = None, until: Optional[datetime.datetime] = None, **kwargs: Any - ) -> None: - """ - :keyword force_upgrade: Whether to force upgrade the cluster. Note that this option instructs - upgrade operation to bypass upgrade protections such as checking for deprecated API usage. - Enable this option only with caution. - :paramtype force_upgrade: bool - :keyword until: Until when the overrides are effective. Note that this only matches the start - time of an upgrade, and the effectiveness won't change once an upgrade starts even if the - ``until`` expires as upgrade proceeds. This field is not set by default. It must be set for the - overrides to take effect. - :paramtype until: ~datetime.datetime - """ - super().__init__(**kwargs) - self.force_upgrade = force_upgrade - self.until = until - - -class VirtualMachineNodes(_serialization.Model): - """Current status on a group of nodes of the same vm size. - - :ivar size: The VM size of the agents used to host this group of nodes. - :vartype size: str - :ivar count: Number of nodes. - :vartype count: int - """ - - _attribute_map = { - "size": {"key": "size", "type": "str"}, - "count": {"key": "count", "type": "int"}, - } - - def __init__(self, *, size: Optional[str] = None, count: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword size: The VM size of the agents used to host this group of nodes. - :paramtype size: str - :keyword count: Number of nodes. - :paramtype count: int - """ - super().__init__(**kwargs) - self.size = size - self.count = count - - -class VirtualMachinesProfile(_serialization.Model): - """Specifications on VirtualMachines agent pool. - - :ivar scale: Specifications on how to scale a VirtualMachines agent pool. - :vartype scale: ~azure.mgmt.containerservice.models.ScaleProfile - """ - - _attribute_map = { - "scale": {"key": "scale", "type": "ScaleProfile"}, - } - - def __init__(self, *, scale: Optional["_models.ScaleProfile"] = None, **kwargs: Any) -> None: - """ - :keyword scale: Specifications on how to scale a VirtualMachines agent pool. - :paramtype scale: ~azure.mgmt.containerservice.models.ScaleProfile - """ - super().__init__(**kwargs) - self.scale = scale - - -class WeeklySchedule(_serialization.Model): - """For schedules like: 'recur every Monday' or 'recur every 3 weeks on Wednesday'. - - All required parameters must be populated in order to send to server. - - :ivar interval_weeks: Specifies the number of weeks between each set of occurrences. Required. - :vartype interval_weeks: int - :ivar day_of_week: Specifies on which day of the week the maintenance occurs. Required. Known - values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype day_of_week: str or ~azure.mgmt.containerservice.models.WeekDay - """ - - _validation = { - "interval_weeks": {"required": True, "maximum": 4, "minimum": 1}, - "day_of_week": {"required": True}, - } - - _attribute_map = { - "interval_weeks": {"key": "intervalWeeks", "type": "int"}, - "day_of_week": {"key": "dayOfWeek", "type": "str"}, - } - - def __init__(self, *, interval_weeks: int, day_of_week: Union[str, "_models.WeekDay"], **kwargs: Any) -> None: - """ - :keyword interval_weeks: Specifies the number of weeks between each set of occurrences. - Required. - :paramtype interval_weeks: int - :keyword day_of_week: Specifies on which day of the week the maintenance occurs. Required. - Known values are: "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and - "Saturday". - :paramtype day_of_week: str or ~azure.mgmt.containerservice.models.WeekDay - """ - super().__init__(**kwargs) - self.interval_weeks = interval_weeks - self.day_of_week = day_of_week - - -class WindowsGmsaProfile(_serialization.Model): - """Windows gMSA Profile in the managed cluster. - - :ivar enabled: Whether to enable Windows gMSA. Specifies whether to enable Windows gMSA in the - managed cluster. - :vartype enabled: bool - :ivar dns_server: Specifies the DNS server for Windows gMSA. :code:`
`\\ :code:`
` Set it - to empty if you have configured the DNS server in the vnet which is used to create the managed - cluster. - :vartype dns_server: str - :ivar root_domain_name: Specifies the root domain name for Windows gMSA. :code:`
`\\ - :code:`
` Set it to empty if you have configured the DNS server in the vnet which is used to - create the managed cluster. - :vartype root_domain_name: str - """ - - _attribute_map = { - "enabled": {"key": "enabled", "type": "bool"}, - "dns_server": {"key": "dnsServer", "type": "str"}, - "root_domain_name": {"key": "rootDomainName", "type": "str"}, - } - - def __init__( - self, - *, - enabled: Optional[bool] = None, - dns_server: Optional[str] = None, - root_domain_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword enabled: Whether to enable Windows gMSA. 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/models/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/models/_patch.py @@ -7,9 +7,9 @@ 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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/__init__.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/__init__.py index 7f09a97cf023..037d985cd842 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/__init__.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,50 +12,50 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import AgentPoolsOperations # type: ignore +from ._operations import ManagedClustersOperations # type: ignore +from ._operations import MaintenanceConfigurationsOperations # type: ignore +from ._operations import ManagedNamespacesOperations # type: ignore +from ._operations import MachinesOperations # type: ignore +from ._operations import PrivateEndpointConnectionsOperations # type: ignore +from ._operations import SnapshotsOperations # type: ignore +from ._operations import ManagedClusterSnapshotsOperations # type: ignore +from ._operations import TrustedAccessRoleBindingsOperations # type: ignore +from ._operations import LoadBalancersOperations # type: ignore +from ._operations import IdentityBindingsOperations # type: ignore +from ._operations import JWTAuthenticatorsOperations # type: ignore +from ._operations import MeshMembershipsOperations # type: ignore from ._operations import Operations # type: ignore -from ._managed_clusters_operations import ManagedClustersOperations # type: ignore -from ._container_service_operations import ContainerServiceOperations # type: ignore -from ._maintenance_configurations_operations import MaintenanceConfigurationsOperations # type: ignore -from ._managed_namespaces_operations import ManagedNamespacesOperations # type: ignore -from ._agent_pools_operations import AgentPoolsOperations # type: ignore -from ._machines_operations import MachinesOperations # type: ignore -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore -from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore -from ._resolve_private_link_service_id_operations import ResolvePrivateLinkServiceIdOperations # type: ignore -from ._operation_status_result_operations import OperationStatusResultOperations # type: ignore -from ._snapshots_operations import SnapshotsOperations # type: ignore -from ._managed_cluster_snapshots_operations import ManagedClusterSnapshotsOperations # type: ignore -from ._trusted_access_roles_operations import TrustedAccessRolesOperations # type: ignore -from ._trusted_access_role_bindings_operations import TrustedAccessRoleBindingsOperations # type: ignore -from ._load_balancers_operations import LoadBalancersOperations # type: ignore -from ._identity_bindings_operations import IdentityBindingsOperations # type: ignore -from ._jwt_authenticators_operations import JWTAuthenticatorsOperations # type: ignore -from ._mesh_memberships_operations import MeshMembershipsOperations # type: ignore +from ._operations import OperationStatusResultOperations # type: ignore +from ._operations import PrivateLinkResourcesOperations # type: ignore +from ._operations import ResolvePrivateLinkServiceIdOperations # type: ignore +from ._operations import TrustedAccessRolesOperations # type: ignore +from ._operations import ContainerServiceOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "Operations", + "AgentPoolsOperations", "ManagedClustersOperations", - "ContainerServiceOperations", "MaintenanceConfigurationsOperations", "ManagedNamespacesOperations", - "AgentPoolsOperations", "MachinesOperations", "PrivateEndpointConnectionsOperations", - "PrivateLinkResourcesOperations", - "ResolvePrivateLinkServiceIdOperations", - "OperationStatusResultOperations", "SnapshotsOperations", "ManagedClusterSnapshotsOperations", - "TrustedAccessRolesOperations", "TrustedAccessRoleBindingsOperations", "LoadBalancersOperations", "IdentityBindingsOperations", "JWTAuthenticatorsOperations", "MeshMembershipsOperations", + "Operations", + "OperationStatusResultOperations", + "PrivateLinkResourcesOperations", + "ResolvePrivateLinkServiceIdOperations", + "TrustedAccessRolesOperations", + "ContainerServiceOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_agent_pools_operations.py deleted file mode 100644 index 0e7265443e16..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_agent_pools_operations.py +++ /dev/null @@ -1,1778 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_abort_latest_operation_request( - resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - subscription_id: str, - *, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if if_none_match is not None: - _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - subscription_id: str, - *, - ignore_pod_disruption_budget: Optional[bool] = None, - if_match: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if ignore_pod_disruption_budget is not None: - _params["ignore-pod-disruption-budget"] = _SERIALIZER.query( - "ignore_pod_disruption_budget", ignore_pod_disruption_budget, "bool" - ) - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_upgrade_profile_request( - resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_complete_upgrade_request( - resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/completeUpgrade", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_machines_request( - resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_available_agent_pool_versions_request( # pylint: disable=name-too-long - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_upgrade_node_image_version_request( - resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class AgentPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`agent_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _abort_latest_operation_initial( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_abort_latest_operation_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_abort_latest_operation( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Aborts last operation running on agent pool. - - Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a - Canceling state and eventually to a Canceled state when cancellation finishes. If the operation - completes before cancellation can take place, an error is returned. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._abort_latest_operation_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> ItemPaged["_models.AgentPool"]: - """Gets a list of agent pools in the specified managed cluster. - - Gets a list of agent pools in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either AgentPool or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AgentPoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AgentPoolListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> _models.AgentPool: - """Gets the specified managed cluster agent pool. - - Gets the specified managed cluster agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: AgentPool or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.AgentPool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AgentPool", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - parameters: Union[_models.AgentPool, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "AgentPool") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - parameters: _models.AgentPool, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AgentPool]: - """Creates or updates an agent pool in the specified managed cluster. - - Creates or updates an agent pool in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param parameters: The agent pool to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.AgentPool - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - parameters: IO[bytes], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.AgentPool]: - """Creates or updates an agent pool in the specified managed cluster. - - Creates or updates an agent pool in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param parameters: The agent pool to create or update. Required. - :type parameters: IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - parameters: Union[_models.AgentPool, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.AgentPool]: - """Creates or updates an agent pool in the specified managed cluster. - - Creates or updates an agent pool in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param parameters: The agent pool to create or update. Is either a AgentPool type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.AgentPool or IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - parameters=parameters, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("AgentPool", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AgentPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AgentPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - ignore_pod_disruption_budget: Optional[bool] = None, - if_match: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - ignore_pod_disruption_budget=ignore_pod_disruption_budget, - if_match=if_match, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - ignore_pod_disruption_budget: Optional[bool] = None, - if_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes an agent pool in the specified managed cluster. - - Deletes an agent pool in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on - a node without considering Pod Disruption Budget. Default value is None. - :type ignore_pod_disruption_budget: bool - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - ignore_pod_disruption_budget=ignore_pod_disruption_budget, - if_match=if_match, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get_upgrade_profile( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> _models.AgentPoolUpgradeProfile: - """Gets the upgrade profile for an agent pool. - - Gets the upgrade profile for an agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: AgentPoolUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.AgentPoolUpgradeProfile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) - - _request = build_get_upgrade_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AgentPoolUpgradeProfile", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _complete_upgrade_initial( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_complete_upgrade_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_complete_upgrade( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Completes the upgrade of an agent pool. - - Completes the upgrade operation for the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._complete_upgrade_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _delete_machines_initial( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(machines, (IOBase, bytes)): - _content = machines - else: - _json = self._serialize.body(machines, "AgentPoolDeleteMachinesParameter") - - _request = build_delete_machines_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_delete_machines( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machines: _models.AgentPoolDeleteMachinesParameter, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Deletes specific machines in an agent pool. - - Deletes specific machines in an agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machines: A list of machines from the agent pool to be deleted. Required. - :type machines: ~azure.mgmt.containerservice.models.AgentPoolDeleteMachinesParameter - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_delete_machines( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machines: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Deletes specific machines in an agent pool. - - Deletes specific machines in an agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machines: A list of machines from the agent pool to be deleted. Required. - :type machines: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_delete_machines( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machines: Union[_models.AgentPoolDeleteMachinesParameter, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Deletes specific machines in an agent pool. - - Deletes specific machines in an agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machines: A list of machines from the agent pool to be deleted. Is either a - AgentPoolDeleteMachinesParameter type or a IO[bytes] type. Required. - :type machines: ~azure.mgmt.containerservice.models.AgentPoolDeleteMachinesParameter or - IO[bytes] - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_machines_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - machines=machines, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get_available_agent_pool_versions( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> _models.AgentPoolAvailableVersions: - """Gets a list of supported Kubernetes versions for the specified agent pool. - - See `supported Kubernetes versions - `_ for more details about - the version lifecycle. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: AgentPoolAvailableVersions or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.AgentPoolAvailableVersions - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) - - _request = build_get_available_agent_pool_versions_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("AgentPoolAvailableVersions", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _upgrade_node_image_version_initial( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_upgrade_node_image_version_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_upgrade_node_image_version( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> LROPoller[_models.AgentPool]: - """Upgrades the node image version of an agent pool to the latest. - - Upgrading the node image version of an agent pool applies the newest OS and runtime updates to - the nodes. AKS provides one new image per week with the latest updates. For more details on - node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: An instance of LROPoller that returns either AgentPool or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.AgentPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._upgrade_node_image_version_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - 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.http_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.AgentPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.AgentPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_container_service_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_container_service_operations.py deleted file mode 100644 index 86a6a5436d02..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_container_service_operations.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_node_image_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/nodeImageVersions", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ContainerServiceOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`container_service` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_node_image_versions(self, location: str, **kwargs: Any) -> ItemPaged["_models.NodeImageVersion"]: - """Gets a list of supported NodeImage versions in the specified subscription. - - Only returns the latest version of each node image. For example there may be an - AKSUbuntu-1804gen2containerd-2024.01.26, but only AKSUbuntu-1804gen2containerd-2024.02.02 is - visible in this list. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either NodeImageVersion or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.NodeImageVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NodeImageVersionsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_node_image_versions_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NodeImageVersionsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_identity_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_identity_bindings_operations.py deleted file mode 100644 index 3249b7931478..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_identity_bindings_operations.py +++ /dev/null @@ -1,763 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_cluster_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/identityBindings", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, resource_name: str, identity_binding_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/identityBindings/{identityBindingName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "identityBindingName": _SERIALIZER.url( - "identity_binding_name", - identity_binding_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-z][a-z0-9]{0,63}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, resource_name: str, identity_binding_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/identityBindings/{identityBindingName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "identityBindingName": _SERIALIZER.url( - "identity_binding_name", - identity_binding_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-z][a-z0-9]{0,63}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, resource_name: str, identity_binding_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/identityBindings/{identityBindingName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "identityBindingName": _SERIALIZER.url( - "identity_binding_name", - identity_binding_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-z][a-z0-9]{0,63}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class IdentityBindingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`identity_bindings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> ItemPaged["_models.IdentityBinding"]: - """Gets a list of identity bindings in the specified managed cluster. - - Gets a list of identity bindings in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either IdentityBinding or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.IdentityBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IdentityBindingListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("IdentityBindingListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any - ) -> _models.IdentityBinding: - """Gets the specified Identity Binding. - - Gets the specified Identity 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 identity_binding_name: The name of the identity binding. Required. - :type identity_binding_name: str - :return: IdentityBinding or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.IdentityBinding - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IdentityBinding] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - identity_binding_name=identity_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("IdentityBinding", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - identity_binding_name: str, - parameters: Union[_models.IdentityBinding, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "IdentityBinding") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - identity_binding_name=identity_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - identity_binding_name: str, - parameters: _models.IdentityBinding, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IdentityBinding]: - """Creates or updates an identity binding in the specified managed cluster. - - Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. - :type identity_binding_name: str - :param parameters: The identity binding to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.IdentityBinding - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either IdentityBinding or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.IdentityBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - identity_binding_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.IdentityBinding]: - """Creates or updates an identity binding in the specified managed cluster. - - Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. - :type identity_binding_name: str - :param parameters: The identity binding to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either IdentityBinding or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.IdentityBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - identity_binding_name: str, - parameters: Union[_models.IdentityBinding, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.IdentityBinding]: - """Creates or updates an identity binding in the specified managed cluster. - - Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. - :type identity_binding_name: str - :param parameters: The identity binding to create or update. Is either a IdentityBinding type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.IdentityBinding or IO[bytes] - :return: An instance of LROPoller that returns either IdentityBinding or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.IdentityBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IdentityBinding] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - identity_binding_name=identity_binding_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("IdentityBinding", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.IdentityBinding].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.IdentityBinding]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - identity_binding_name=identity_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if response.status_code == 204: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an identity binding in the specified managed cluster. - - Deletes an identity binding 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 identity_binding_name: The name of the identity binding. Required. - :type identity_binding_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - identity_binding_name=identity_binding_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_jwt_authenticators_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_jwt_authenticators_operations.py deleted file mode 100644 index 6489c0f7412b..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_jwt_authenticators_operations.py +++ /dev/null @@ -1,767 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_cluster_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/jwtAuthenticators", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, resource_name: str, jwt_authenticator_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/jwtAuthenticators/{jwtAuthenticatorName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "jwtAuthenticatorName": _SERIALIZER.url( - "jwt_authenticator_name", - jwt_authenticator_name, - "str", - max_length=24, - min_length=1, - pattern=r"^[a-z][a-z0-9]{0,23}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, resource_name: str, jwt_authenticator_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/jwtAuthenticators/{jwtAuthenticatorName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "jwtAuthenticatorName": _SERIALIZER.url( - "jwt_authenticator_name", - jwt_authenticator_name, - "str", - max_length=24, - min_length=1, - pattern=r"^[a-z][a-z0-9]{0,23}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, resource_name: str, jwt_authenticator_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/jwtAuthenticators/{jwtAuthenticatorName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "jwtAuthenticatorName": _SERIALIZER.url( - "jwt_authenticator_name", - jwt_authenticator_name, - "str", - max_length=24, - min_length=1, - pattern=r"^[a-z][a-z0-9]{0,23}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class JWTAuthenticatorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`jwt_authenticators` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> ItemPaged["_models.JWTAuthenticator"]: - """Gets a list of JWT authenticators in the specified managed cluster. - - Gets a list of JWT authenticators in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either JWTAuthenticator or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.JWTAuthenticator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JWTAuthenticatorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JWTAuthenticatorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any - ) -> _models.JWTAuthenticator: - """Gets the specified JWT authenticator of a managed cluster. - - Gets the specified JWT authenticator 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 jwt_authenticator_name: The name of the JWT authenticator. Required. - :type jwt_authenticator_name: str - :return: JWTAuthenticator or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.JWTAuthenticator - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JWTAuthenticator] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - jwt_authenticator_name=jwt_authenticator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JWTAuthenticator", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - jwt_authenticator_name: str, - parameters: Union[_models.JWTAuthenticator, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "JWTAuthenticator") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - jwt_authenticator_name=jwt_authenticator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - jwt_authenticator_name: str, - parameters: _models.JWTAuthenticator, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JWTAuthenticator]: - """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param jwt_authenticator_name: The name of the JWT authenticator. Required. - :type jwt_authenticator_name: str - :param parameters: The JWT authenticator to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.JWTAuthenticator - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either JWTAuthenticator or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - jwt_authenticator_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JWTAuthenticator]: - """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param jwt_authenticator_name: The name of the JWT authenticator. Required. - :type jwt_authenticator_name: str - :param parameters: The JWT authenticator to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either JWTAuthenticator or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - jwt_authenticator_name: str, - parameters: Union[_models.JWTAuthenticator, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.JWTAuthenticator]: - """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to - apply the settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param jwt_authenticator_name: The name of the JWT authenticator. Required. - :type jwt_authenticator_name: str - :param parameters: The JWT authenticator to create or update. Is either a JWTAuthenticator type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.JWTAuthenticator or IO[bytes] - :return: An instance of LROPoller that returns either JWTAuthenticator or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JWTAuthenticator] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - jwt_authenticator_name=jwt_authenticator_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("JWTAuthenticator", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.JWTAuthenticator].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JWTAuthenticator]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - jwt_authenticator_name=jwt_authenticator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if response.status_code == 204: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a JWT authenticator and updates the managed cluster to apply the settings. - - Deletes a JWT authenticator and updates the managed cluster to apply the settings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param jwt_authenticator_name: The name of the JWT authenticator. Required. - :type jwt_authenticator_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - jwt_authenticator_name=jwt_authenticator_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_load_balancers_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_load_balancers_operations.py deleted file mode 100644 index 900f787e48c3..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_load_balancers_operations.py +++ /dev/null @@ -1,682 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_cluster_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, resource_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "loadBalancerName": _SERIALIZER.url( - "load_balancer_name", - load_balancer_name, - "str", - max_length=12, - min_length=1, - pattern=r"^[a-z][a-z0-9]{0,11}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, resource_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "loadBalancerName": _SERIALIZER.url( - "load_balancer_name", - load_balancer_name, - "str", - max_length=12, - min_length=1, - pattern=r"^[a-z][a-z0-9]{0,11}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, resource_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "loadBalancerName": _SERIALIZER.url( - "load_balancer_name", - load_balancer_name, - "str", - max_length=12, - min_length=1, - pattern=r"^[a-z][a-z0-9]{0,11}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class LoadBalancersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`load_balancers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> ItemPaged["_models.LoadBalancer"]: - """Gets a list of load balancers in the specified managed cluster. - - Gets a list of load balancers in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either LoadBalancer or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.LoadBalancer] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LoadBalancerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LoadBalancerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any - ) -> _models.LoadBalancer: - """Gets the specified load balancer. - - Gets the specified load balancer. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param load_balancer_name: The name of the load balancer. Required. - :type load_balancer_name: str - :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.LoadBalancer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - load_balancer_name=load_balancer_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("LoadBalancer", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - load_balancer_name: str, - parameters: _models.LoadBalancer, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LoadBalancer: - """Creates or updates a load balancer in the specified managed cluster. - - Creates or updates a load balancer in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param load_balancer_name: The name of the load balancer. Required. - :type load_balancer_name: str - :param parameters: The load balancer to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.LoadBalancer - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.LoadBalancer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - load_balancer_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.LoadBalancer: - """Creates or updates a load balancer in the specified managed cluster. - - Creates or updates a load balancer in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param load_balancer_name: The name of the load balancer. Required. - :type load_balancer_name: str - :param parameters: The load balancer to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.LoadBalancer - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - load_balancer_name: str, - parameters: Union[_models.LoadBalancer, IO[bytes]], - **kwargs: Any - ) -> _models.LoadBalancer: - """Creates or updates a load balancer in the specified managed cluster. - - Creates or updates a load balancer in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param load_balancer_name: The name of the load balancer. Required. - :type load_balancer_name: str - :param parameters: The load balancer to create or update. Is either a LoadBalancer type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.LoadBalancer or IO[bytes] - :return: LoadBalancer or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.LoadBalancer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "LoadBalancer") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - load_balancer_name=load_balancer_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("LoadBalancer", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - load_balancer_name=load_balancer_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if response.status_code == 204: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a load balancer in the specified managed cluster. - - Deletes a load balancer in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param load_balancer_name: The name of the load balancer. Required. - :type load_balancer_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - load_balancer_name=load_balancer_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_machines_operations.py deleted file mode 100644 index f3437cc5437d..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_machines_operations.py +++ /dev/null @@ -1,643 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machine_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - "machineName": _SERIALIZER.url( - "machine_name", machine_name, "str", pattern=r"^[a-z][a-z0-9]{0,11}$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,39}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machine_name: str, - subscription_id: str, - *, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - "machineName": _SERIALIZER.url( - "machine_name", machine_name, "str", pattern=r"^[a-z][a-z0-9]{0,11}$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,39}$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if if_none_match is not None: - _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class MachinesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`machines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.Machine"]: - """Gets a list of machines in the specified agent pool. - - Gets a list of machines in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :return: An iterator like instance of either Machine or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.Machine] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MachineListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MachineListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, machine_name: str, **kwargs: Any - ) -> _models.Machine: - """Get a specific machine in the specified agent pool. - - Get a specific machine in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machine_name: Host name of the machine. Required. - :type machine_name: str - :return: Machine or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Machine - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Machine] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - machine_name=machine_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Machine", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machine_name: str, - parameters: Union[_models.Machine, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Machine") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - machine_name=machine_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machine_name: str, - parameters: _models.Machine, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Machine]: - """Creates or updates a machine in the specified agent pool. - - Creates or updates a machine in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machine_name: Host name of the machine. Required. - :type machine_name: str - :param parameters: The machine to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.Machine - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Machine or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.Machine] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machine_name: str, - parameters: IO[bytes], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Machine]: - """Creates or updates a machine in the specified agent pool. - - Creates or updates a machine in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machine_name: Host name of the machine. Required. - :type machine_name: str - :param parameters: The machine to create or update. Required. - :type parameters: IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either Machine or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.Machine] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - machine_name: str, - parameters: Union[_models.Machine, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.Machine]: - """Creates or updates a machine in the specified agent pool. - - Creates or updates a machine in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param machine_name: Host name of the machine. Required. - :type machine_name: str - :param parameters: The machine to create or update. Is either a Machine type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.containerservice.models.Machine or IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :return: An instance of LROPoller that returns either Machine or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.Machine] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Machine] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - machine_name=machine_name, - parameters=parameters, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - 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("Machine", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Machine].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Machine]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_maintenance_configurations_operations.py deleted file mode 100644 index d9e0da3dd10c..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_maintenance_configurations_operations.py +++ /dev/null @@ -1,599 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_cluster_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, resource_name: str, config_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "configName": _SERIALIZER.url("config_name", config_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, resource_name: str, config_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "configName": _SERIALIZER.url("config_name", config_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, resource_name: str, config_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "configName": _SERIALIZER.url("config_name", config_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class MaintenanceConfigurationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`maintenance_configurations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> ItemPaged["_models.MaintenanceConfiguration"]: - """Gets a list of maintenance configurations in the specified managed cluster. - - Gets a list of maintenance configurations in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either MaintenanceConfiguration or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.MaintenanceConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MaintenanceConfigurationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MaintenanceConfigurationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, 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. Supported values are 'default', - 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. - :type config_name: str - :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - config_name=config_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - config_name: str, - parameters: _models.MaintenanceConfiguration, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.MaintenanceConfiguration: - """Creates or updates a maintenance configuration in the specified managed cluster. - - Creates or updates a maintenance configuration in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param config_name: The name of the maintenance configuration. Supported values are 'default', - 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. - :type config_name: str - :param parameters: The maintenance configuration to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.MaintenanceConfiguration - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - config_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.MaintenanceConfiguration: - """Creates or updates a maintenance configuration in the specified managed cluster. - - Creates or updates a maintenance configuration in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param config_name: The name of the maintenance configuration. Supported values are 'default', - 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. - :type config_name: str - :param parameters: The maintenance configuration to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - config_name: str, - parameters: Union[_models.MaintenanceConfiguration, IO[bytes]], - **kwargs: Any - ) -> _models.MaintenanceConfiguration: - """Creates or updates a maintenance configuration in the specified managed cluster. - - Creates or updates a maintenance configuration in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param config_name: The name of the maintenance configuration. Supported values are 'default', - 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. - :type config_name: str - :param parameters: The maintenance configuration to create or update. Is either a - MaintenanceConfiguration type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.MaintenanceConfiguration or IO[bytes] - :return: MaintenanceConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "MaintenanceConfiguration") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - config_name=config_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MaintenanceConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any - ) -> None: - """Deletes a maintenance configuration. - - Deletes a maintenance configuration. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param config_name: The name of the maintenance configuration. Supported values are 'default', - 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. - :type config_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - config_name=config_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_managed_cluster_snapshots_operations.py deleted file mode 100644 index 8b8f0f930a82..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_managed_cluster_snapshots_operations.py +++ /dev/null @@ -1,851 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_tags_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedClusterSnapshotsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`managed_cluster_snapshots` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.ManagedClusterSnapshot"]: - """Gets a list of managed cluster snapshots in the specified subscription. - - Gets a list of managed cluster snapshots in the specified subscription. - - :return: An iterator like instance of either ManagedClusterSnapshot or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.ManagedClusterSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedClusterSnapshotListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedClusterSnapshot"]: - """Lists managed cluster snapshots in the specified subscription and resource group. - - Lists managed cluster snapshots in the specified subscription and resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either ManagedClusterSnapshot or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.ManagedClusterSnapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterSnapshotListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedClusterSnapshotListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedClusterSnapshot: - """Gets a managed cluster snapshot. - - Gets a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.ManagedClusterSnapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Creates or updates a managed cluster snapshot. - - Creates or updates a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster snapshot to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Creates or updates a managed cluster snapshot. - - Creates or updates a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster snapshot to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedClusterSnapshot, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Creates or updates a managed cluster snapshot. - - Creates or updates a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster snapshot to create or update. Is either a - ManagedClusterSnapshot type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot or IO[bytes] - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedClusterSnapshot") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.TagsObject, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Updates tags on a managed cluster snapshot. - - Updates tags on a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. - Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Updates tags on a managed cluster snapshot. - - Updates tags on a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. - Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedClusterSnapshot: - """Updates tags on a managed cluster snapshot. - - Updates tags on a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. - Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject or IO[bytes] - :return: ManagedClusterSnapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TagsObject") - - _request = build_update_tags_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedClusterSnapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> None: - """Deletes a managed cluster snapshot. - - Deletes a managed cluster snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_managed_clusters_operations.py deleted file mode 100644 index 54bc012203c7..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_managed_clusters_operations.py +++ /dev/null @@ -1,4668 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_kubernetes_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters" - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_upgrade_profile_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_access_profile_request( - resource_group_name: str, resource_name: str, role_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "roleName": _SERIALIZER.url("role_name", role_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_cluster_admin_credentials_request( # pylint: disable=name-too-long - resource_group_name: str, - resource_name: str, - subscription_id: str, - *, - server_fqdn: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if server_fqdn is not None: - _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_cluster_user_credentials_request( # pylint: disable=name-too-long - resource_group_name: str, - resource_name: str, - subscription_id: str, - *, - server_fqdn: Optional[str] = None, - format: Optional[Union[str, _models.Format]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if server_fqdn is not None: - _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") - if format is not None: - _params["format"] = _SERIALIZER.query("format", format, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_cluster_monitoring_user_credentials_request( # pylint: disable=name-too-long - resource_group_name: str, - resource_name: str, - subscription_id: str, - *, - server_fqdn: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if server_fqdn is not None: - _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - *, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if if_none_match is not None: - _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_tags_request( - resource_group_name: str, resource_name: str, subscription_id: str, *, if_match: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - resource_name: str, - subscription_id: str, - *, - if_match: Optional[str] = None, - ignore_pod_disruption_budget: Optional[bool] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - if ignore_pod_disruption_budget is not None: - _params["ignore-pod-disruption-budget"] = _SERIALIZER.query( - "ignore_pod_disruption_budget", ignore_pod_disruption_budget, "bool" - ) - - # Construct headers - if if_match is not None: - _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_reset_service_principal_profile_request( # pylint: disable=name-too-long - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_reset_aad_profile_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_abort_latest_operation_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rotate_cluster_certificates_request( # pylint: disable=name-too-long - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rotate_service_account_signing_keys_request( # pylint: disable=name-too-long - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_stop_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_start_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_run_command_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_command_result_request( - resource_group_name: str, resource_name: str, command_id: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "commandId": _SERIALIZER.url("command_id", command_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_outbound_network_dependencies_endpoints_request( # pylint: disable=name-too-long - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_guardrails_versions_request( - location: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions/{version}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "version": _SERIALIZER.url("version", version, "str", max_length=24, min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_guardrails_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_safeguards_versions_request( - location: str, version: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions/{version}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "version": _SERIALIZER.url("version", version, "str", max_length=24, min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_safeguards_versions_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_mesh_revision_profiles_request( # pylint: disable=name-too-long - location: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_mesh_revision_profile_request( - location: str, mode: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - "mode": _SERIALIZER.url( - "mode", - mode, - "str", - max_length=24, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_mesh_upgrade_profiles_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_mesh_upgrade_profile_request( - resource_group_name: str, resource_name: str, mode: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "mode": _SERIALIZER.url( - "mode", - mode, - "str", - max_length=24, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_rebalance_load_balancers_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedClustersOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`managed_clusters` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.KubernetesVersionListResult: - """Gets a list of supported Kubernetes versions in the specified subscription. - - Contains extra metadata on the version, including supported patch versions, capabilities, - available upgrades, and details on preview status of the version. - - :param location: The name of the Azure region. Required. - :type location: str - :return: KubernetesVersionListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.KubernetesVersionListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) - - _request = build_list_kubernetes_versions_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("KubernetesVersionListResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.ManagedCluster"]: - """Gets a list of managed clusters in the specified subscription. - - Gets a list of managed clusters in the specified subscription. - - :return: An iterator like instance of either ManagedCluster or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.ManagedCluster"]: - """Lists managed clusters in the specified subscription and resource group. - - Lists managed clusters in the specified subscription and resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either ManagedCluster or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_upgrade_profile( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> _models.ManagedClusterUpgradeProfile: - """Gets the upgrade profile of a managed cluster. - - Gets the upgrade profile of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: ManagedClusterUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterUpgradeProfile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) - - _request = build_get_upgrade_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedClusterUpgradeProfile", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_access_profile( - self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any - ) -> _models.ManagedClusterAccessProfile: - """Gets an access profile of a managed cluster. - - **WARNING**\\ : This API will be deprecated. Instead use `ListClusterUserCredentials - `_ or - `ListClusterAdminCredentials - `_ . - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param role_name: The name of the role for managed cluster accessProfile resource. Required. - :type role_name: str - :return: ManagedClusterAccessProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedClusterAccessProfile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) - - _request = build_get_access_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - role_name=role_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedClusterAccessProfile", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_cluster_admin_credentials( - self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any - ) -> _models.CredentialResults: - """Lists the admin credentials of a managed cluster. - - Lists the admin credentials of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. - :type server_fqdn: str - :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.CredentialResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) - - _request = build_list_cluster_admin_credentials_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - server_fqdn=server_fqdn, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CredentialResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_cluster_user_credentials( - self, - resource_group_name: str, - resource_name: str, - server_fqdn: Optional[str] = None, - format: Optional[Union[str, _models.Format]] = None, - **kwargs: Any - ) -> _models.CredentialResults: - """Lists the user credentials of a managed cluster. - - Lists the user credentials of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. - :type server_fqdn: str - :param format: Only apply to AAD clusters, specifies the format of returned kubeconfig. Format - 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format - kubeconfig, which requires kubelogin binary in the path. Known values are: "azure", "exec", and - "exec". Default value is None. - :type format: str or ~azure.mgmt.containerservice.models.Format - :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.CredentialResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) - - _request = build_list_cluster_user_credentials_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - server_fqdn=server_fqdn, - format=format, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CredentialResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_cluster_monitoring_user_credentials( - self, resource_group_name: str, resource_name: str, server_fqdn: Optional[str] = None, **kwargs: Any - ) -> _models.CredentialResults: - """Lists the cluster monitoring user credentials of a managed cluster. - - Lists the cluster monitoring user credentials of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param server_fqdn: server fqdn type for credentials to be returned. Default value is None. - :type server_fqdn: str - :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.CredentialResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) - - _request = build_list_cluster_monitoring_user_credentials_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - server_fqdn=server_fqdn, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CredentialResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: - """Gets a managed cluster. - - Gets a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: ManagedCluster or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedCluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedCluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedCluster, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedCluster") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.ManagedCluster, - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedCluster]: - """Creates or updates a managed cluster. - - Creates or updates a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedCluster - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedCluster]: - """Creates or updates a managed cluster. - - Creates or updates a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster to create or update. Required. - :type parameters: IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedCluster, IO[bytes]], - if_match: Optional[str] = None, - if_none_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.ManagedCluster]: - """Creates or updates a managed cluster. - - Creates or updates a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The managed cluster to create or update. Is either a ManagedCluster type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedCluster or IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param if_none_match: The request should only proceed if no entity matches this string. Default - value is None. - :type if_none_match: str - :return: An instance of LROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - if_match=if_match, - if_none_match=if_none_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedCluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ManagedCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_tags_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TagsObject") - - _request = build_update_tags_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.TagsObject, - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedCluster]: - """Updates tags on a managed cluster. - - Updates tags on a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - if_match: Optional[str] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedCluster]: - """Updates tags on a managed cluster. - - Updates tags on a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. - :type parameters: IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO[bytes]], - if_match: Optional[str] = None, - **kwargs: Any - ) -> LROPoller[_models.ManagedCluster]: - """Updates tags on a managed cluster. - - Updates tags on a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Is either - a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject or IO[bytes] - :param if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :return: An instance of LROPoller that returns either ManagedCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_tags_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - parameters=parameters, - if_match=if_match, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedCluster", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ManagedCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - resource_name: str, - if_match: Optional[str] = None, - ignore_pod_disruption_budget: Optional[bool] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - if_match=if_match, - ignore_pod_disruption_budget=ignore_pod_disruption_budget, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - resource_name: str, - if_match: Optional[str] = None, - 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 if_match: The request should only proceed if an entity matches this string. Default - value is None. - :type if_match: str - :param ignore_pod_disruption_budget: ignore-pod-disruption-budget=true to delete those pods on - a node without considering Pod Disruption Budget. Default value is None. - :type ignore_pod_disruption_budget: bool - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - if_match=if_match, - ignore_pod_disruption_budget=ignore_pod_disruption_budget, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _reset_service_principal_profile_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedClusterServicePrincipalProfile") - - _request = build_reset_service_principal_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @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.models.ManagedClusterServicePrincipalProfile - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_reset_service_principal_profile( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Reset the Service Principal Profile of a managed cluster. - - This action cannot be performed on a cluster that is not using a service principal. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The service principal profile to set on the managed cluster. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_reset_service_principal_profile( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedClusterServicePrincipalProfile, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Reset the Service Principal Profile of a managed cluster. - - This action cannot be performed on a cluster that is not using a service principal. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The service principal profile to set on the managed cluster. Is either a - ManagedClusterServicePrincipalProfile type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterServicePrincipalProfile or - IO[bytes] - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._reset_service_principal_profile_initial( - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _reset_aad_profile_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedClusterAADProfile") - - _request = build_reset_aad_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_reset_aad_profile( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.ManagedClusterAADProfile, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Reset the AAD Profile of a managed cluster. - - **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory - integration `_ to update your cluster with AKS-managed Azure - AD. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The AAD profile to set on the Managed Cluster. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_reset_aad_profile( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Reset the AAD Profile of a managed cluster. - - **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory - integration `_ to update your cluster with AKS-managed Azure - AD. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The AAD profile to set on the Managed Cluster. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_reset_aad_profile( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.ManagedClusterAADProfile, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Reset the AAD Profile of a managed cluster. - - **WARNING**\\ : This API will be deprecated. Please see `AKS-managed Azure Active Directory - integration `_ to update your cluster with AKS-managed Azure - AD. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The AAD profile to set on the Managed Cluster. Is either a - ManagedClusterAADProfile type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile or IO[bytes] - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._reset_aad_profile_initial( - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _abort_latest_operation_initial( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_abort_latest_operation_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_abort_latest_operation( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Aborts last operation running on managed cluster. - - Aborts the currently running operation on the managed cluster. The Managed Cluster will be - moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If - the operation completes before cancellation can take place, an error is returned. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._abort_latest_operation_initial( - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _rotate_cluster_certificates_initial( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_rotate_cluster_certificates_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_rotate_cluster_certificates( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Rotates the certificates of a managed cluster. - - See `Certificate rotation `_ for - more details about rotating managed cluster certificates. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._rotate_cluster_certificates_initial( - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _rotate_service_account_signing_keys_initial( # pylint: disable=name-too-long - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_rotate_service_account_signing_keys_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Rotates the service account signing keys of a managed cluster. - - Rotates the service account signing keys of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._rotate_service_account_signing_keys_initial( - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _stop_initial(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_stop_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: - """Stops a Managed Cluster. - - This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a - cluster stops the control plane and agent nodes entirely, while maintaining all object and - cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster - `_ for more details about stopping a - cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._stop_initial( - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _start_initial(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_start_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: - """Starts a previously stopped Managed Cluster. - - See `starting a cluster `_ for more - details about starting a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._start_initial( - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _run_command_initial( - self, - resource_group_name: str, - resource_name: str, - request_payload: Union[_models.RunCommandRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(request_payload, (IOBase, bytes)): - _content = request_payload - else: - _json = self._serialize.body(request_payload, "RunCommandRequest") - - _request = build_run_command_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @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.models.RunCommandRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either RunCommandResult or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_run_command( - self, - resource_group_name: str, - resource_name: str, - request_payload: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RunCommandResult]: - """Submits a command to run against the Managed Cluster. - - AKS will create a pod to run the command. This is primarily useful for private clusters. For - more information see `AKS Run Command - `_. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param request_payload: The run command request. Required. - :type request_payload: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either RunCommandResult or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_run_command( - self, - resource_group_name: str, - resource_name: str, - request_payload: Union[_models.RunCommandRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.RunCommandResult]: - """Submits a command to run against the Managed Cluster. - - AKS will create a pod to run the command. This is primarily useful for private clusters. For - more information see `AKS Run Command - `_. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param request_payload: The run command request. Is either a RunCommandRequest type or a - IO[bytes] type. Required. - :type request_payload: ~azure.mgmt.containerservice.models.RunCommandRequest or IO[bytes] - :return: An instance of LROPoller that returns either RunCommandResult or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.RunCommandResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RunCommandResult] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._run_command_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - request_payload=request_payload, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("RunCommandResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.RunCommandResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.RunCommandResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get_command_result( - self, resource_group_name: str, resource_name: str, command_id: str, **kwargs: Any - ) -> Optional[_models.RunCommandResult]: - """Gets the results of a command which has been run on the Managed Cluster. - - Gets the results of a command which has been run on the Managed Cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param command_id: Id of the command. Required. - :type command_id: str - :return: RunCommandResult or None or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.RunCommandResult or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) - - _request = build_get_command_result_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - command_id=command_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - response_headers = {} - if response.status_code == 200: - deserialized = self._deserialize("RunCommandResult", pipeline_response.http_response) - - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> ItemPaged["_models.OutboundEnvironmentEndpoint"]: - """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the - specified managed cluster. - - Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the - specified managed cluster. The operation returns properties of each egress endpoint. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either OutboundEnvironmentEndpoint or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.OutboundEnvironmentEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_outbound_network_dependencies_endpoints_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> _models.GuardrailsAvailableVersion: - """Gets supported Guardrails version in the specified subscription and location. - - Contains Guardrails version along with its support info and whether it is a default version. - - :param location: The name of the Azure region. Required. - :type location: str - :param version: Safeguards version. Required. - :type version: str - :return: GuardrailsAvailableVersion or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.GuardrailsAvailableVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) - - _request = build_get_guardrails_versions_request( - location=location, - version=version, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GuardrailsAvailableVersion", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_guardrails_versions(self, location: str, **kwargs: Any) -> ItemPaged["_models.GuardrailsAvailableVersion"]: - """Gets a list of supported Guardrails versions in the specified subscription and location. - - Contains list of Guardrails version along with its support info and whether it is a default - version. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either GuardrailsAvailableVersion or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.GuardrailsAvailableVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GuardrailsAvailableVersionsList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_guardrails_versions_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GuardrailsAvailableVersionsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_safeguards_versions(self, location: str, version: str, **kwargs: Any) -> _models.SafeguardsAvailableVersion: - """Gets supported Safeguards version in the specified subscription and location. - - Contains Safeguards version along with its support info and whether it is a default version. - - :param location: The name of the Azure region. Required. - :type location: str - :param version: Safeguards version. Required. - :type version: str - :return: SafeguardsAvailableVersion or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.SafeguardsAvailableVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) - - _request = build_get_safeguards_versions_request( - location=location, - version=version, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SafeguardsAvailableVersion", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_safeguards_versions(self, location: str, **kwargs: Any) -> ItemPaged["_models.SafeguardsAvailableVersion"]: - """Gets a list of supported Safeguards versions in the specified subscription and location. - - Contains list of Safeguards version along with its support info and whether it is a default - version. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either SafeguardsAvailableVersion or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.SafeguardsAvailableVersion] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SafeguardsAvailableVersionsList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_safeguards_versions_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SafeguardsAvailableVersionsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> ItemPaged["_models.MeshRevisionProfile"]: - """Lists mesh revision profiles for all meshes in the specified location. - - Contains extra metadata on each revision, including supported revisions, cluster compatibility - and available upgrades. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either MeshRevisionProfile or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.MeshRevisionProfile] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshRevisionProfileList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_mesh_revision_profiles_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MeshRevisionProfileList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _models.MeshRevisionProfile: - """Gets a mesh revision profile for a specified mesh in the specified location. - - Contains extra metadata on the revision, including supported revisions, cluster compatibility - and available upgrades. - - :param location: The name of the Azure region. Required. - :type location: str - :param mode: The mode of the mesh. Required. - :type mode: str - :return: MeshRevisionProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MeshRevisionProfile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) - - _request = build_get_mesh_revision_profile_request( - location=location, - mode=mode, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MeshRevisionProfile", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_mesh_upgrade_profiles( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> ItemPaged["_models.MeshUpgradeProfile"]: - """Lists available upgrades for all service meshes in a specific cluster. - - Lists available upgrades for all service meshes in a specific cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either MeshUpgradeProfile or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.MeshUpgradeProfile] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshUpgradeProfileList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_mesh_upgrade_profiles_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MeshUpgradeProfileList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_mesh_upgrade_profile( - self, resource_group_name: str, resource_name: str, mode: str, **kwargs: Any - ) -> _models.MeshUpgradeProfile: - """Gets available upgrades for a service mesh in a cluster. - - Gets available upgrades for a service mesh in a cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param mode: The mode of the mesh. Required. - :type mode: str - :return: MeshUpgradeProfile or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MeshUpgradeProfile - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) - - _request = build_get_mesh_upgrade_profile_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - mode=mode, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MeshUpgradeProfile", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _rebalance_load_balancers_initial( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "RebalanceLoadBalancersRequestBody") - - _request = build_rebalance_load_balancers_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_rebalance_load_balancers( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.RebalanceLoadBalancersRequestBody, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Rebalance nodes across specific load balancers. - - Rebalance nodes across specific load balancers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load - balancers will be rebalanced. Required. - :type parameters: ~azure.mgmt.containerservice.models.RebalanceLoadBalancersRequestBody - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_rebalance_load_balancers( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Rebalance nodes across specific load balancers. - - Rebalance nodes across specific load balancers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load - balancers will be rebalanced. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_rebalance_load_balancers( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.RebalanceLoadBalancersRequestBody, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Rebalance nodes across specific load balancers. - - Rebalance nodes across specific load balancers. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load - balancers will be rebalanced. Is either a RebalanceLoadBalancersRequestBody type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.containerservice.models.RebalanceLoadBalancersRequestBody or - IO[bytes] - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._rebalance_load_balancers_initial( - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_managed_namespaces_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_managed_namespaces_operations.py deleted file mode 100644 index e382578b39f1..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_managed_namespaces_operations.py +++ /dev/null @@ -1,1086 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_cluster_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, resource_name: str, managed_namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "managedNamespaceName": _SERIALIZER.url( - "managed_namespace_name", - managed_namespace_name, - "str", - max_length=63, - min_length=1, - pattern=r"[a-z0-9]([-a-z0-9]*[a-z0-9])?", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, resource_name: str, managed_namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "managedNamespaceName": _SERIALIZER.url( - "managed_namespace_name", - managed_namespace_name, - "str", - max_length=63, - min_length=1, - pattern=r"[a-z0-9]([-a-z0-9]*[a-z0-9])?", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, resource_name: str, managed_namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "managedNamespaceName": _SERIALIZER.url( - "managed_namespace_name", - managed_namespace_name, - "str", - max_length=63, - min_length=1, - pattern=r"[a-z0-9]([-a-z0-9]*[a-z0-9])?", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, resource_name: str, managed_namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "managedNamespaceName": _SERIALIZER.url( - "managed_namespace_name", - managed_namespace_name, - "str", - max_length=63, - min_length=1, - pattern=r"[a-z0-9]([-a-z0-9]*[a-z0-9])?", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_credential_request( - resource_group_name: str, resource_name: str, managed_namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}/listCredential", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "managedNamespaceName": _SERIALIZER.url( - "managed_namespace_name", - managed_namespace_name, - "str", - max_length=63, - min_length=1, - pattern=r"[a-z0-9]([-a-z0-9]*[a-z0-9])?", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedNamespacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`managed_namespaces` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedNamespace"]: - """Gets a list of managed namespaces in the specified managed cluster. - - Gets a list of managed namespaces in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either ManagedNamespace or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.ManagedNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedNamespaceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedNamespaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any - ) -> _models.ManagedNamespace: - """Gets the specified namespace of a managed cluster. - - Gets the specified namespace of a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :return: ManagedNamespace or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedNamespace", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: Union[_models.ManagedNamespace, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedNamespace") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: _models.ManagedNamespace, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNamespace]: - """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: The namespace to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedNamespace - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ManagedNamespace or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedNamespace]: - """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: The namespace to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ManagedNamespace or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: Union[_models.ManagedNamespace, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedNamespace]: - """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - Creates or updates a namespace managed by ARM for the specified managed cluster. Users can - configure aspects like resource quotas, network ingress/egress policies, and more. See - aka.ms/aks/managed-namespaces for more details. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: The namespace to create or update. Is either a ManagedNamespace type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.ManagedNamespace or IO[bytes] - :return: An instance of LROPoller that returns either ManagedNamespace or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response_headers = {} - response = pipeline_response.http_response - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = self._deserialize("ManagedNamespace", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ManagedNamespace].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedNamespace]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - if response.status_code == 204: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a namespace. - - Deletes a namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @overload - def update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: _models.TagsObject, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedNamespace: - """Updates tags on a managed namespace. - - Updates tags on a managed namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: Parameters supplied to the patch namespace operation, we only support patch - tags for now. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedNamespace or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedNamespace: - """Updates tags on a managed namespace. - - Updates tags on a managed namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: Parameters supplied to the patch namespace operation, we only support patch - tags for now. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedNamespace or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - resource_name: str, - managed_namespace_name: str, - parameters: Union[_models.TagsObject, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedNamespace: - """Updates tags on a managed namespace. - - Updates tags on a managed namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :param parameters: Parameters supplied to the patch namespace operation, we only support patch - tags for now. Is either a TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject or IO[bytes] - :return: ManagedNamespace or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TagsObject") - - _request = build_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ManagedNamespace", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_credential( - self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any - ) -> _models.CredentialResults: - """Lists the credentials of a namespace. - - Lists the credentials of a namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param managed_namespace_name: The name of the managed namespace. Required. - :type managed_namespace_name: str - :return: CredentialResults or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.CredentialResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) - - _request = build_list_credential_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - managed_namespace_name=managed_namespace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CredentialResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_mesh_memberships_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_mesh_memberships_operations.py deleted file mode 100644 index c6a4f2f11111..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_mesh_memberships_operations.py +++ /dev/null @@ -1,738 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_cluster_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshMemberships", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, resource_name: str, mesh_membership_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshMemberships/{meshMembershipName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "meshMembershipName": _SERIALIZER.url( - "mesh_membership_name", - mesh_membership_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z][a-zA-Z0-9]{0,62}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, resource_name: str, mesh_membership_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshMemberships/{meshMembershipName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "meshMembershipName": _SERIALIZER.url( - "mesh_membership_name", - mesh_membership_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z][a-zA-Z0-9]{0,62}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, resource_name: str, mesh_membership_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshMemberships/{meshMembershipName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "meshMembershipName": _SERIALIZER.url( - "mesh_membership_name", - mesh_membership_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z][a-zA-Z0-9]{0,62}$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class MeshMembershipsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`mesh_memberships` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_cluster( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> ItemPaged["_models.MeshMembership"]: - """Lists mesh memberships in a managed cluster. - - Lists mesh memberships in a managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either MeshMembership or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.MeshMembership] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshMembershipsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_cluster_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MeshMembershipsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any - ) -> _models.MeshMembership: - """Gets the mesh membership of a managed cluster. - - Gets the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. - :type mesh_membership_name: str - :return: MeshMembership or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.MeshMembership - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MeshMembership] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - mesh_membership_name=mesh_membership_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MeshMembership", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - mesh_membership_name: str, - parameters: Union[_models.MeshMembership, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "MeshMembership") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - mesh_membership_name=mesh_membership_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - mesh_membership_name: str, - parameters: _models.MeshMembership, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MeshMembership]: - """Creates or updates the mesh membership of a managed cluster. - - Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. - :type mesh_membership_name: str - :param parameters: The mesh membership to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.MeshMembership - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either MeshMembership or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.MeshMembership] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - mesh_membership_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MeshMembership]: - """Creates or updates the mesh membership of a managed cluster. - - Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. - :type mesh_membership_name: str - :param parameters: The mesh membership to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either MeshMembership or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.MeshMembership] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - mesh_membership_name: str, - parameters: Union[_models.MeshMembership, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.MeshMembership]: - """Creates or updates the mesh membership of a managed cluster. - - Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. - :type mesh_membership_name: str - :param parameters: The mesh membership to create or update. Is either a MeshMembership type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.MeshMembership or IO[bytes] - :return: An instance of LROPoller that returns either MeshMembership or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.MeshMembership] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MeshMembership] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - mesh_membership_name=mesh_membership_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("MeshMembership", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.MeshMembership].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.MeshMembership]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - mesh_membership_name=mesh_membership_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the mesh membership of a managed cluster. - - Deletes the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. - :type mesh_membership_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - mesh_membership_name=mesh_membership_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_operation_status_result_operations.py deleted file mode 100644 index e7f0e2a6c0dc..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_operation_status_result_operations.py +++ /dev/null @@ -1,413 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, resource_name: str, operation_id: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations/{operationId}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "operationId": _SERIALIZER.url("operation_id", operation_id, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_by_agent_pool_request( - resource_group_name: str, - resource_name: str, - agent_pool_name: str, - operation_id: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/operations/{operationId}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "agentPoolName": _SERIALIZER.url( - "agent_pool_name", agent_pool_name, "str", max_length=12, min_length=1, pattern=r"^[a-z][a-z0-9]{0,11}$" - ), - "operationId": _SERIALIZER.url("operation_id", operation_id, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class OperationStatusResultOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`operation_status_result` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> ItemPaged["_models.OperationStatusResult"]: - """Gets a list of operations in the specified managedCluster. - - Gets a list of operations in the specified managedCluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either OperationStatusResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.OperationStatusResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationStatusResultList] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OperationStatusResultList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, resource_name: str, operation_id: str, **kwargs: Any - ) -> _models.OperationStatusResult: - """Get the status of a specific operation in the specified managed cluster. - - Get the status of a specific operation in the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param operation_id: The ID of an ongoing async operation. Required. - :type operation_id: str - :return: OperationStatusResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.OperationStatusResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OperationStatusResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get_by_agent_pool( - self, resource_group_name: str, resource_name: str, agent_pool_name: str, operation_id: str, **kwargs: Any - ) -> _models.OperationStatusResult: - """Get the status of a specific operation in the specified agent pool. - - Get the status of a specific operation in the specified agent pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param agent_pool_name: The name of the agent pool. Required. - :type agent_pool_name: str - :param operation_id: The ID of an ongoing async operation. Required. - :type operation_id: str - :return: OperationStatusResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.OperationStatusResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) - - _request = build_get_by_agent_pool_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - agent_pool_name=agent_pool_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("OperationStatusResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_operations.py index 58823c1de17d..44de2f490b51 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_operations.py @@ -1,34 +1,46 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse -from azure.core import PipelineClient +from azure.core import MatchConditions, PipelineClient from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, + ResourceModifiedError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models from .._configuration import ContainerServiceClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer +from .._utils.utils import prep_if_match, prep_if_none_match +from .._validation import api_version_validation +JSON = MutableMapping[str, Any] T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] List = list @@ -37,7 +49,9 @@ _SERIALIZER.client_side_validation = False -def build_list_request(**kwargs: Any) -> HttpRequest: +def build_agent_pools_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 {}) @@ -45,28 +59,15760 @@ def build_list_request(**kwargs: Any) -> HttpRequest: accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.ContainerService/operations") + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_pools_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_pools_delete_request( + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + subscription_id: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ignore_pod_disruption_budget is not None: + _params["ignore-pod-disruption-budget"] = _SERIALIZER.query( + "ignore_pod_disruption_budget", ignore_pod_disruption_budget, "bool" + ) + + # Construct headers + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_pools_list_request( + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_pools_abort_latest_operation_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/abort" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_agent_pools_complete_upgrade_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/completeUpgrade" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_agent_pools_delete_machines_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/deleteMachines" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_pools_upgrade_node_image_version_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_pools_get_available_agent_pool_versions_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_agent_pools_get_upgrade_profile_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_get_request( + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + # 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") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_delete_request( + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if ignore_pod_disruption_budget is not None: + _params["ignore-pod-disruption-budget"] = _SERIALIZER.query( + "ignore_pod_disruption_budget", ignore_pod_disruption_budget, "bool" + ) + + # Construct headers + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_get_access_profile_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, role_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "roleName": _SERIALIZER.url("role_name", role_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_cluster_admin_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_cluster_user_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterUserCredential" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + if format is not None: + _params["format"] = _SERIALIZER.query("format", format, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_cluster_monitoring_user_credentials_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + subscription_id: str, + *, + server_fqdn: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if server_fqdn is not None: + _params["server-fqdn"] = _SERIALIZER.query("server_fqdn", server_fqdn, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_reset_service_principal_profile_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_reset_aad_profile_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_rotate_cluster_certificates_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_clusters_abort_latest_operation_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/abort" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_clusters_rotate_service_account_signing_keys_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_clusters_stop_request( + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_clusters_start_request( + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/start" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_clusters_run_command_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/runCommand" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_get_command_result_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, command_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/commandResults/{commandId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "commandId": _SERIALIZER.url("command_id", command_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_outbound_network_dependencies_endpoints_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/outboundNetworkDependenciesEndpoints" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_rebalance_load_balancers_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rebalanceLoadBalancers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_get_upgrade_profile_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_get_guardrails_versions_request( # pylint: disable=name-too-long + location: str, version: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions/{version}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_guardrails_versions_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/guardrailsVersions" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_get_safeguards_versions_request( # pylint: disable=name-too-long + location: str, version: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions/{version}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "version": _SERIALIZER.url("version", version, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_safeguards_versions_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/safeguardsVersions" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_get_mesh_revision_profile_request( # pylint: disable=name-too-long + location: str, mode: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles/{mode}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "mode": _SERIALIZER.url("mode", mode, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_mesh_revision_profiles_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/meshRevisionProfiles" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_get_mesh_upgrade_profile_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, mode: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "mode": _SERIALIZER.url("mode", mode, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_mesh_upgrade_profiles_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_clusters_list_kubernetes_versions_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_configurations_create_or_update_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_configurations_delete_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, config_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "configName": _SERIALIZER.url("config_name", config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_maintenance_configurations_list_by_managed_cluster_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_namespaces_get_request( + resource_group_name: str, resource_name: str, managed_namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "managedNamespaceName": _SERIALIZER.url("managed_namespace_name", managed_namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_namespaces_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, managed_namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "managedNamespaceName": _SERIALIZER.url("managed_namespace_name", managed_namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_namespaces_update_request( + resource_group_name: str, resource_name: str, managed_namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "managedNamespaceName": _SERIALIZER.url("managed_namespace_name", managed_namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_namespaces_delete_request( + resource_group_name: str, resource_name: str, managed_namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "managedNamespaceName": _SERIALIZER.url("managed_namespace_name", managed_namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_namespaces_list_by_managed_cluster_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_namespaces_list_credential_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, managed_namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/managedNamespaces/{managedNamespaceName}/listCredential" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "managedNamespaceName": _SERIALIZER.url("managed_namespace_name", managed_namespace_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_machines_get_request( + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + "machineName": _SERIALIZER.url("machine_name", machine_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_machines_create_or_update_request( + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + subscription_id: str, + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines/{machineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + "machineName": _SERIALIZER.url("machine_name", machine_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if_match = prep_if_match(etag, match_condition) + if if_match is not None: + _headers["If-Match"] = _SERIALIZER.header("if_match", if_match, "str") + if_none_match = prep_if_none_match(etag, match_condition) + if if_none_match is not None: + _headers["If-None-Match"] = _SERIALIZER.header("if_none_match", if_none_match, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_machines_list_request( + resource_group_name: str, resource_name: str, agent_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/machines" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoint_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoint_connections_update_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoint_connections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_private_endpoint_connections_list_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_snapshots_get_request( + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_snapshots_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_snapshots_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_snapshots_delete_request( + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_snapshots_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_snapshots_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_cluster_snapshots_get_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_cluster_snapshots_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_cluster_snapshots_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_cluster_snapshots_delete_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_cluster_snapshots_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_cluster_snapshots_list_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_trusted_access_role_bindings_get_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", trusted_access_role_binding_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_trusted_access_role_bindings_create_or_update_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", trusted_access_role_binding_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_trusted_access_role_bindings_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "trustedAccessRoleBindingName": _SERIALIZER.url( + "trusted_access_role_binding_name", trusted_access_role_binding_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_trusted_access_role_bindings_list_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_get_request( + resource_group_name: str, resource_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_load_balancers_delete_request( + resource_group_name: str, resource_name: str, load_balancer_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers/{loadBalancerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "loadBalancerName": _SERIALIZER.url("load_balancer_name", load_balancer_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_load_balancers_list_by_managed_cluster_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/loadBalancers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_identity_bindings_get_request( + resource_group_name: str, resource_name: str, identity_binding_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/identityBindings/{identityBindingName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "identityBindingName": _SERIALIZER.url("identity_binding_name", identity_binding_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_identity_bindings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, identity_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/identityBindings/{identityBindingName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "identityBindingName": _SERIALIZER.url("identity_binding_name", identity_binding_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_identity_bindings_delete_request( + resource_group_name: str, resource_name: str, identity_binding_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/identityBindings/{identityBindingName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "identityBindingName": _SERIALIZER.url("identity_binding_name", identity_binding_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_identity_bindings_list_by_managed_cluster_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/identityBindings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jwt_authenticators_get_request( + resource_group_name: str, resource_name: str, jwt_authenticator_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/jwtAuthenticators/{jwtAuthenticatorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "jwtAuthenticatorName": _SERIALIZER.url("jwt_authenticator_name", jwt_authenticator_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jwt_authenticators_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, jwt_authenticator_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/jwtAuthenticators/{jwtAuthenticatorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "jwtAuthenticatorName": _SERIALIZER.url("jwt_authenticator_name", jwt_authenticator_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jwt_authenticators_delete_request( + resource_group_name: str, resource_name: str, jwt_authenticator_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/jwtAuthenticators/{jwtAuthenticatorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "jwtAuthenticatorName": _SERIALIZER.url("jwt_authenticator_name", jwt_authenticator_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_jwt_authenticators_list_by_managed_cluster_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/jwtAuthenticators" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_mesh_memberships_get_request( + resource_group_name: str, resource_name: str, mesh_membership_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshMemberships/{meshMembershipName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "meshMembershipName": _SERIALIZER.url("mesh_membership_name", mesh_membership_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_mesh_memberships_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, mesh_membership_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshMemberships/{meshMembershipName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "meshMembershipName": _SERIALIZER.url("mesh_membership_name", mesh_membership_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_mesh_memberships_delete_request( + resource_group_name: str, resource_name: str, mesh_membership_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshMemberships/{meshMembershipName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "meshMembershipName": _SERIALIZER.url("mesh_membership_name", mesh_membership_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_mesh_memberships_list_by_managed_cluster_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshMemberships" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_operations_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _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) + + +def build_operation_status_result_get_by_agent_pool_request( # pylint: disable=name-too-long + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + operation_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/operations/{operationId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "agentPoolName": _SERIALIZER.url("agent_pool_name", agent_pool_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_operation_status_result_list_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/operations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_operation_status_result_get_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, operation_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.ContainerService/managedClusters/{resourceName}/operations/{operationId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_resources_list_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_resolve_private_link_service_id_post_request( # pylint: disable=name-too-long + resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "resourceName": _SERIALIZER.url("resource_name", resource_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_trusted_access_roles_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = ( + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles" + ) + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_container_service_list_node_image_versions_request( # pylint: disable=name-too-long + location: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/nodeImageVersions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class AgentPoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`agent_pools` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: AgentPool. The AgentPool is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.AgentPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) + + _request = build_agent_pools_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AgentPool, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: Union[_models.AgentPool, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_pools_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, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: _models.AgentPool, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """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.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 etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AgentPool. The AgentPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.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: JSON, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AgentPool. The AgentPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """Creates or updates an agent pool in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param parameters: The agent pool to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AgentPool. The AgentPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.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, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.AgentPool]: + """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 one of the following types: + AgentPool, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.AgentPool or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns AgentPool. The AgentPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AgentPool] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + parameters=parameters, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.AgentPool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.AgentPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.AgentPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_agent_pools_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, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[None]: + """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 + :keyword 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. + :paramtype ignore_pod_disruption_budget: bool + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> ItemPaged["_models.AgentPool"]: + """Gets a list of agent pools in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of AgentPool + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.AgentPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.AgentPool]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_agent_pools_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.AgentPool], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _abort_latest_operation_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_agent_pools_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Aborts last operation running on agent pool. + + Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a + Canceling state and eventually to a Canceled state when cancellation finishes. If the operation + completes before cancellation can take place, a 409 error code is returned. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._abort_latest_operation_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "agent_pool_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def _complete_upgrade_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_agent_pools_complete_upgrade_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "agent_pool_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def begin_complete_upgrade( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Completes the upgrade of an agent pool. + + Completes the upgrade operation for the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._complete_upgrade_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _delete_machines_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(machines, (IOBase, bytes)): + _content = machines + else: + _content = json.dumps(machines, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_agent_pools_delete_machines_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: _models.AgentPoolDeleteMachinesParameter, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: ~azure.mgmt.containerservice.models.AgentPoolDeleteMachinesParameter + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Required. + :type machines: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_delete_machines( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machines: Union[_models.AgentPoolDeleteMachinesParameter, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes specific machines in an agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machines: A list of machines from the agent pool to be deleted. Is one of the following + types: AgentPoolDeleteMachinesParameter, JSON, IO[bytes] Required. + :type machines: ~azure.mgmt.containerservice.models.AgentPoolDeleteMachinesParameter or JSON or + IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_machines_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machines=machines, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _upgrade_node_image_version_initial( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_agent_pools_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_upgrade_node_image_version( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> LROPoller[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 + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._upgrade_node_image_version_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get_available_agent_pool_versions( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.AgentPoolAvailableVersions: + """Gets a list of supported Kubernetes versions for the specified agent pool. + + See `supported Kubernetes versions + `_ for more details about + the version lifecycle. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: AgentPoolAvailableVersions. The AgentPoolAvailableVersions is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.AgentPoolAvailableVersions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AgentPoolAvailableVersions] = kwargs.pop("cls", None) + + _request = build_agent_pools_get_available_agent_pool_versions_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AgentPoolAvailableVersions, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # 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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: AgentPoolUpgradeProfile. The AgentPoolUpgradeProfile is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.AgentPoolUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.AgentPoolUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_agent_pools_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.AgentPoolUpgradeProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +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.ContainerServiceClient`'s + :attr:`managed_clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedCluster: + """Gets a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: ManagedCluster. The ManagedCluster is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedCluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedCluster, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedCluster, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """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.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 etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ManagedCluster. The ManagedCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ManagedCluster. The ManagedCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Creates or updates a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The managed cluster to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ManagedCluster. The ManagedCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.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, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """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 one of the following types: + ManagedCluster, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedCluster or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ManagedCluster. The ManagedCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_tags_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """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.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 etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ManagedCluster. The ManagedCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ManagedCluster. The ManagedCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """Updates tags on a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: Parameters supplied to the Update Managed Cluster Tags operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ManagedCluster. The ManagedCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.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, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedCluster]: + """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 one of + the following types: TagsObject, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.TagsObject or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns ManagedCluster. The ManagedCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedCluster] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_tags_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + params_added_on={"2025-10-02-preview": ["ignore_pod_disruption_budget"]}, + api_versions_list=["2025-10-01", "2025-10-02-preview"], + ) + def _delete_initial( + self, + resource_group_name: str, + resource_name: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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, + etag=etag, + match_condition=match_condition, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + params_added_on={"2025-10-02-preview": ["ignore_pod_disruption_budget"]}, + api_versions_list=["2025-10-01", "2025-10-02-preview"], + ) + def begin_delete( + self, + resource_group_name: str, + resource_name: str, + *, + ignore_pod_disruption_budget: Optional[bool] = None, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[None]: + """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 + :keyword 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. + :paramtype ignore_pod_disruption_budget: bool + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + ignore_pod_disruption_budget=ignore_pod_disruption_budget, + etag=etag, + match_condition=match_condition, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.ManagedCluster"]: + """Lists managed clusters in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ManagedCluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedCluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedCluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.ManagedCluster"]: + """Gets a list of managed clusters in the specified subscription. + + :return: An iterator like instance of ManagedCluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.ManagedCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedCluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedCluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_access_profile( + self, resource_group_name: str, resource_name: str, role_name: str, **kwargs: Any + ) -> _models.ManagedClusterAccessProfile: + """Gets an access profile of a managed cluster. + + **WARNING**: This API will be deprecated. Instead use `ListClusterUserCredentials + `_ or + `ListClusterAdminCredentials + `_ . + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param role_name: The name of the role for managed cluster accessProfile resource. Required. + :type role_name: str + :return: ManagedClusterAccessProfile. The ManagedClusterAccessProfile is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterAccessProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedClusterAccessProfile] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedClusterAccessProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_admin_credentials( + self, resource_group_name: str, resource_name: str, *, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the admin credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. The name 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :paramtype server_fqdn: str + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_user_credentials( + self, + resource_group_name: str, + resource_name: str, + *, + server_fqdn: Optional[str] = None, + format: Optional[Union[str, _models.Format]] = None, + **kwargs: Any + ) -> _models.CredentialResults: + """Lists the user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. The name 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :paramtype server_fqdn: str + :keyword 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. + :paramtype format: str or ~azure.mgmt.containerservice.models.Format + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_cluster_monitoring_user_credentials( + self, resource_group_name: str, resource_name: str, *, server_fqdn: Optional[str] = None, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the cluster monitoring user credentials of a managed cluster. + + :param resource_group_name: The name of the resource group. The name 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 server_fqdn: server fqdn type for credentials to be returned. Default value is None. + :paramtype server_fqdn: str + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _reset_service_principal_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterServicePrincipalProfile, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_reset_service_principal_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # 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.models.ManagedClusterServicePrincipalProfile + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :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: JSON, + *, + 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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reset_service_principal_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The service principal profile to set on the managed cluster. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :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, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Reset the Service Principal Profile of a managed cluster. + + This action cannot be performed on a cluster that is not using a service principal. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The service principal profile to set on the managed cluster. Is one of the + following types: ManagedClusterServicePrincipalProfile, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterServicePrincipalProfile or + JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reset_service_principal_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _reset_aad_profile_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterAADProfile, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_reset_aad_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterAADProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**: This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :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: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**: This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_reset_aad_profile( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**: This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :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, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Reset the AAD Profile of a managed cluster. + + **WARNING**: This API will be deprecated. Please see `AKS-managed Azure Active Directory + integration `_ to update your cluster with AKS-managed Azure + AD. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The AAD profile to set on the Managed Cluster. Is one of the following + types: ManagedClusterAADProfile, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterAADProfile or JSON or + IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._reset_aad_profile_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _rotate_cluster_certificates_initial( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_rotate_cluster_certificates_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_rotate_cluster_certificates( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Rotates the certificates of a managed cluster. + + See `Certificate rotation `_ for + more details about rotating managed cluster certificates. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._rotate_cluster_certificates_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _abort_latest_operation_initial( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_abort_latest_operation_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_abort_latest_operation( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Aborts last operation running on managed cluster. + + Aborts the currently running operation on the managed cluster. The Managed Cluster will be + moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If + the operation completes before cancellation can take place, a 409 error code is returned. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._abort_latest_operation_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _rotate_service_account_signing_keys_initial( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_rotate_service_account_signing_keys_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_rotate_service_account_signing_keys( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Rotates the service account signing keys of a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._rotate_service_account_signing_keys_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _stop_initial(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_stop_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_stop(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: + """Stops a Managed Cluster. + + This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a + cluster stops the control plane and agent nodes entirely, while maintaining all object and + cluster state. A cluster does not accrue charges while it is stopped. See `stopping a cluster + `_ for more details about stopping a + cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._stop_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _start_initial(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_start_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_start(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> LROPoller[None]: + """Starts a previously stopped Managed Cluster. + + See `starting a cluster `_ for more + details about starting a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._start_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _run_command_initial( + self, + resource_group_name: str, + resource_name: str, + request_payload: Union[_models.RunCommandRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(request_payload, (IOBase, bytes)): + _content = request_payload + else: + _content = json.dumps(request_payload, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_run_command_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: _models.RunCommandRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param request_payload: The run command request. Required. + :type request_payload: ~azure.mgmt.containerservice.models.RunCommandRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns RunCommandResult. The RunCommandResult is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: JSON, + *, + 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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns RunCommandResult. The RunCommandResult is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_run_command( + self, + resource_group_name: str, + resource_name: str, + request_payload: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param request_payload: The run command request. Required. + :type request_payload: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns RunCommandResult. The RunCommandResult is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.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, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RunCommandResult]: + """Submits a command to run against the Managed Cluster. + + AKS will create a pod to run the command. This is primarily useful for private clusters. For + more information see `AKS Run Command + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param request_payload: The run command request. Is one of the following types: + RunCommandRequest, JSON, IO[bytes] Required. + :type request_payload: ~azure.mgmt.containerservice.models.RunCommandRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns RunCommandResult. The RunCommandResult is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.RunCommandResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RunCommandResult] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._run_command_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + request_payload=request_payload, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.RunCommandResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RunCommandResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RunCommandResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get_command_result( + self, resource_group_name: str, resource_name: str, command_id: str, **kwargs: Any + ) -> Optional[_models.RunCommandResult]: + """Gets the results of a command which has been run on the Managed Cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param command_id: Id of the command. Required. + :type command_id: str + :return: RunCommandResult or None. The RunCommandResult is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.RunCommandResult or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Optional[_models.RunCommandResult]] = kwargs.pop("cls", None) + + _request = build_managed_clusters_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RunCommandResult, response.json()) + + if response.status_code == 202: + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_outbound_network_dependencies_endpoints( # pylint: disable=name-too-long + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> ItemPaged["_models.OutboundEnvironmentEndpoint"]: + """Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. + + Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the + specified managed cluster. The operation returns properties of each egress endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of OutboundEnvironmentEndpoint + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.OutboundEnvironmentEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OutboundEnvironmentEndpoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_outbound_network_dependencies_endpoints_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OutboundEnvironmentEndpoint], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "content_type", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def _rebalance_load_balancers_initial( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_clusters_rebalance_load_balancers_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.RebalanceLoadBalancersRequestBody, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Rebalance nodes across specific load balancers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Required. + :type parameters: ~azure.mgmt.containerservice.models.RebalanceLoadBalancersRequestBody + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Rebalance nodes across specific load balancers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Rebalance nodes across specific load balancers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "content_type", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def begin_rebalance_load_balancers( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.RebalanceLoadBalancersRequestBody, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Rebalance nodes across specific load balancers. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The names of the load balancers to be rebalanced. If set to empty, all load + balancers will be rebalanced. Is one of the following types: RebalanceLoadBalancersRequestBody, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.RebalanceLoadBalancersRequestBody or JSON + or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._rebalance_load_balancers_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get_upgrade_profile( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.ManagedClusterUpgradeProfile: + """Gets the upgrade profile of a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: ManagedClusterUpgradeProfile. The ManagedClusterUpgradeProfile is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedClusterUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedClusterUpgradeProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def get_guardrails_versions(self, location: str, version: str, **kwargs: Any) -> _models.GuardrailsAvailableVersion: + """Gets supported Guardrails version in the specified subscription and location. + + Contains Guardrails version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: GuardrailsAvailableVersion. The GuardrailsAvailableVersion is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.GuardrailsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GuardrailsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_guardrails_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GuardrailsAvailableVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_guardrails_versions(self, location: str, **kwargs: Any) -> ItemPaged["_models.GuardrailsAvailableVersion"]: + """Gets a list of supported Guardrails versions in the specified subscription and location. + + Contains list of Guardrails version along with its support info and whether it is a default + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of GuardrailsAvailableVersion + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.GuardrailsAvailableVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.GuardrailsAvailableVersion]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_guardrails_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.GuardrailsAvailableVersion], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_safeguards_versions(self, location: str, version: str, **kwargs: Any) -> _models.SafeguardsAvailableVersion: + """Gets supported Safeguards version in the specified subscription and location. + + Contains Safeguards version along with its support info and whether it is a default version. + + :param location: The name of the Azure region. Required. + :type location: str + :param version: Safeguards version. Required. + :type version: str + :return: SafeguardsAvailableVersion. The SafeguardsAvailableVersion is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.SafeguardsAvailableVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SafeguardsAvailableVersion] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_safeguards_versions_request( + location=location, + version=version, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SafeguardsAvailableVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_safeguards_versions(self, location: str, **kwargs: Any) -> ItemPaged["_models.SafeguardsAvailableVersion"]: + """Gets a list of supported Safeguards versions in the specified subscription and location. + + Contains list of Safeguards version along with its support info and whether it is a default + version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of SafeguardsAvailableVersion + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.SafeguardsAvailableVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SafeguardsAvailableVersion]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_safeguards_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SafeguardsAvailableVersion], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_mesh_revision_profile(self, location: str, mode: str, **kwargs: Any) -> _models.MeshRevisionProfile: + """Gets a mesh revision profile for a specified mesh in the specified location. + + Contains extra metadata on the revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :type location: str + :param mode: The mode of the mesh. Required. + :type mode: str + :return: MeshRevisionProfile. The MeshRevisionProfile is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MeshRevisionProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MeshRevisionProfile] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_mesh_revision_profile_request( + location=location, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MeshRevisionProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_mesh_revision_profiles(self, location: str, **kwargs: Any) -> ItemPaged["_models.MeshRevisionProfile"]: + """Lists mesh revision profiles for all meshes in the specified location. + + Contains extra metadata on each revision, including supported revisions, cluster compatibility + and available upgrades. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of MeshRevisionProfile + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.MeshRevisionProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MeshRevisionProfile]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_mesh_revision_profiles_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MeshRevisionProfile], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_mesh_upgrade_profile( + self, resource_group_name: str, resource_name: str, mode: str, **kwargs: Any + ) -> _models.MeshUpgradeProfile: + """Gets available upgrades for a service mesh in a cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param mode: The mode of the mesh. Required. + :type mode: str + :return: MeshUpgradeProfile. The MeshUpgradeProfile is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MeshUpgradeProfile + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MeshUpgradeProfile] = kwargs.pop("cls", None) + + _request = build_managed_clusters_get_mesh_upgrade_profile_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mode=mode, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MeshUpgradeProfile, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_mesh_upgrade_profiles( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> ItemPaged["_models.MeshUpgradeProfile"]: + """Lists available upgrades for all service meshes in a specific cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of MeshUpgradeProfile + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.MeshUpgradeProfile] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MeshUpgradeProfile]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_clusters_list_mesh_upgrade_profiles_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MeshUpgradeProfile], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_kubernetes_versions(self, location: str, **kwargs: Any) -> _models.KubernetesVersionListResult: + """Gets a list of supported Kubernetes versions in the specified subscription. + + Contains extra metadata on the version, including supported patch versions, capabilities, + available upgrades, and details on preview status of the version. + + :param location: The name of the Azure region. Required. + :type location: str + :return: KubernetesVersionListResult. The KubernetesVersionListResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.KubernetesVersionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.KubernetesVersionListResult] = kwargs.pop("cls", None) + + _request = build_managed_clusters_list_kubernetes_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.KubernetesVersionListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class MaintenanceConfigurationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`maintenance_configurations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @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. + + :param resource_group_name: The name of the resource group. The name is 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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) + + _request = build_maintenance_configurations_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MaintenanceConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: _models.MaintenanceConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is 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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :param parameters: The maintenance configuration to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.MaintenanceConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :param parameters: The maintenance configuration to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + config_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """Creates or updates a maintenance configuration in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is 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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :param parameters: The maintenance configuration to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.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, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.MaintenanceConfiguration: + """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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :param parameters: The maintenance configuration to create or update. Is one of the following + types: MaintenanceConfiguration, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.MaintenanceConfiguration or JSON or + IO[bytes] + :return: MaintenanceConfiguration. The MaintenanceConfiguration is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MaintenanceConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MaintenanceConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_maintenance_configurations_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MaintenanceConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, config_name: str, **kwargs: Any + ) -> None: + """Deletes a maintenance configuration. + + :param resource_group_name: The name of the resource group. The name is 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. Supported values are 'default', + 'aksManagedAutoUpgradeSchedule', or 'aksManagedNodeOSUpgradeSchedule'. Required. + :type config_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_maintenance_configurations_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + config_name=config_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> ItemPaged["_models.MaintenanceConfiguration"]: + """Gets a list of maintenance configurations in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of MaintenanceConfiguration + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.MaintenanceConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MaintenanceConfiguration]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_maintenance_configurations_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MaintenanceConfiguration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedNamespacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`managed_namespaces` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any + ) -> _models.ManagedNamespace: + """Gets the specified namespace of a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :return: ManagedNamespace. The ManagedNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) + + _request = build_managed_namespaces_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedNamespace, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: Union[_models.ManagedNamespace, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_namespaces_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: _models.ManagedNamespace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedNamespace]: + """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can + configure aspects like resource quotas, network ingress/egress policies, and more. See + aka.ms/aks/managed-namespaces for more details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: The namespace to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedNamespace + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedNamespace. The ManagedNamespace is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedNamespace]: + """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can + configure aspects like resource quotas, network ingress/egress policies, and more. See + aka.ms/aks/managed-namespaces for more details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: The namespace to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedNamespace. The ManagedNamespace is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedNamespace]: + """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can + configure aspects like resource quotas, network ingress/egress policies, and more. See + aka.ms/aks/managed-namespaces for more details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: The namespace to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedNamespace. The ManagedNamespace is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: Union[_models.ManagedNamespace, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedNamespace]: + """Creates or updates a namespace managed by ARM for the specified managed cluster. Users can + configure aspects like resource quotas, network ingress/egress policies, and more. See + aka.ms/aks/managed-namespaces for more details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: The namespace to create or update. Is one of the following types: + ManagedNamespace, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedNamespace or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedNamespace. The ManagedNamespace is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.ManagedNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedNamespace, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedNamespace].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedNamespace]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedNamespace: + """Updates tags on a managed namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Required. + :type parameters: ~azure.mgmt.containerservice.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedNamespace. The ManagedNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedNamespace: + """Updates tags on a managed namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedNamespace. The ManagedNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedNamespace: + """Updates tags on a managed namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedNamespace. The ManagedNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + resource_name: str, + managed_namespace_name: str, + parameters: Union[_models.TagsObject, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedNamespace: + """Updates tags on a managed namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :param parameters: Parameters supplied to the patch namespace operation, we only support patch + tags for now. Is one of the following types: TagsObject, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.TagsObject or JSON or IO[bytes] + :return: ManagedNamespace. The ManagedNamespace is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedNamespace + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedNamespace] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_namespaces_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedNamespace, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_namespaces_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedNamespace"]: + """Gets a list of managed namespaces in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of ManagedNamespace + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.ManagedNamespace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedNamespace]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_namespaces_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedNamespace], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_credential( + self, resource_group_name: str, resource_name: str, managed_namespace_name: str, **kwargs: Any + ) -> _models.CredentialResults: + """Lists the credentials of a namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param managed_namespace_name: The name of the managed namespace. Required. + :type managed_namespace_name: str + :return: CredentialResults. The CredentialResults is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.CredentialResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CredentialResults] = kwargs.pop("cls", None) + + _request = build_managed_namespaces_list_credential_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + managed_namespace_name=managed_namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CredentialResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class MachinesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`machines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, machine_name: str, **kwargs: Any + ) -> _models.Machine: + """Get a specific machine in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machine_name: Host name of the machine. Required. + :type machine_name: str + :return: Machine. The Machine is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Machine + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Machine] = kwargs.pop("cls", None) + + _request = build_machines_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Machine, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "agent_pool_name", + "machine_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + parameters: Union[_models.Machine, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + if match_condition == MatchConditions.IfNotModified: + error_map[412] = ResourceModifiedError + elif match_condition == MatchConditions.IfPresent: + error_map[412] = ResourceNotFoundError + elif match_condition == MatchConditions.IfMissing: + error_map[412] = ResourceExistsError + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_machines_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + subscription_id=self._config.subscription_id, + etag=etag, + match_condition=match_condition, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + parameters: _models.Machine, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.Machine]: + """Creates or updates a machine in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machine_name: Host name of the machine. Required. + :type machine_name: str + :param parameters: The machine to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.Machine + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Machine. The Machine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.Machine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.Machine]: + """Creates or updates a machine in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machine_name: Host name of the machine. Required. + :type machine_name: str + :param parameters: The machine to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Machine. The Machine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.Machine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.Machine]: + """Creates or updates a machine in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machine_name: Host name of the machine. Required. + :type machine_name: str + :param parameters: The machine to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Machine. The Machine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.Machine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "agent_pool_name", + "machine_name", + "content_type", + "accept", + "etag", + "match_condition", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + agent_pool_name: str, + machine_name: str, + parameters: Union[_models.Machine, JSON, IO[bytes]], + *, + etag: Optional[str] = None, + match_condition: Optional[MatchConditions] = None, + **kwargs: Any + ) -> LROPoller[_models.Machine]: + """Creates or updates a machine in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param machine_name: Host name of the machine. Required. + :type machine_name: str + :param parameters: The machine to create or update. Is one of the following types: Machine, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.Machine or JSON or IO[bytes] + :keyword etag: check if resource is changed. Set None to skip checking etag. Default value is + None. + :paramtype etag: str + :keyword match_condition: The match condition to use upon the etag. Default value is None. + :paramtype match_condition: ~azure.core.MatchConditions + :return: An instance of LROPoller that returns Machine. The Machine is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.Machine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Machine] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + machine_name=machine_name, + parameters=parameters, + etag=etag, + match_condition=match_condition, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Machine, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Machine].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Machine]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, **kwargs: Any + ) -> ItemPaged["_models.Machine"]: + """Gets a list of machines in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :return: An iterator like instance of Machine + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.Machine] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Machine]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_machines_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Machine], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PrivateEndpointConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets the specified private endpoint connection. + + To learn more about private clusters, see: + `https://docs.microsoft.com/azure/aks/private-clusters + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is 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.models.PrivateEndpointConnection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Updates a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: The updated private endpoint connection. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.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, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """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 one of the following types: + PrivateEndpointConnection, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.PrivateEndpointConnection or JSON or + IO[bytes] + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_private_endpoint_connections_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnectionListResult: + """Gets a list of private endpoint connections in the specified managed cluster. + + To learn more about private clusters, see: + `https://docs.microsoft.com/azure/aks/private-clusters + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: PrivateEndpointConnectionListResult. The PrivateEndpointConnectionListResult is + compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnectionListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnectionListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class SnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`snapshots` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.Snapshot: + """Gets a snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + _request = build_snapshots_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Snapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.Snapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. The name is 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.models.Snapshot + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Creates or updates a snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The snapshot to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.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, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.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 one of the following types: Snapshot, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.Snapshot or JSON or IO[bytes] + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_snapshots_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Snapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + :param resource_group_name: The name of the resource group. The name is 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.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Snapshot: + """Updates tags on a snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: Parameters supplied to the Update snapshot Tags operation. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.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 one of the + following types: TagsObject, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.TagsObject or JSON or IO[bytes] + :return: Snapshot. The Snapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.Snapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_snapshots_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Snapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_snapshots_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Snapshot"]: + """Lists snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Snapshot + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Snapshot]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_snapshots_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Snapshot], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Snapshot"]: + """Gets a list of snapshots in the specified subscription. + + :return: An iterator like instance of Snapshot + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.Snapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Snapshot]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_snapshots_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Snapshot], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedClusterSnapshotsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`managed_cluster_snapshots` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.ManagedClusterSnapshot: + """Gets a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + _request = build_managed_cluster_snapshots_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedClusterSnapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.ManagedClusterSnapshot, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is 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.models.ManagedClusterSnapshot + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Creates or updates a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: The managed cluster snapshot to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.ManagedClusterSnapshot, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """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 one of the following + types: ManagedClusterSnapshot, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot or JSON or + IO[bytes] + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_cluster_snapshots_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedClusterSnapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is 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.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """Updates tags on a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: Parameters supplied to the Update managed cluster snapshot Tags operation. + Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def update_tags( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.TagsObject, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedClusterSnapshot: + """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 one of the following types: TagsObject, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.TagsObject or JSON or IO[bytes] + :return: ManagedClusterSnapshot. The ManagedClusterSnapshot is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.ManagedClusterSnapshot + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedClusterSnapshot] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_cluster_snapshots_update_tags_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedClusterSnapshot, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> None: + """Deletes a managed cluster snapshot. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_cluster_snapshots_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={"2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + api_versions_list=["2025-10-02-preview"], + ) + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedClusterSnapshot"]: + """Lists managed cluster snapshots in the specified subscription and resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ManagedClusterSnapshot + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.ManagedClusterSnapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedClusterSnapshot]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_cluster_snapshots_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedClusterSnapshot], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={"2025-10-02-preview": ["api_version", "subscription_id", "accept"]}, + api_versions_list=["2025-10-02-preview"], + ) + def list(self, **kwargs: Any) -> ItemPaged["_models.ManagedClusterSnapshot"]: + """Gets a list of managed cluster snapshots in the specified subscription. + + :return: An iterator like instance of ManagedClusterSnapshot + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.ManagedClusterSnapshot] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedClusterSnapshot]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_cluster_snapshots_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedClusterSnapshot], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class TrustedAccessRoleBindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`trusted_access_role_bindings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @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. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :return: TrustedAccessRoleBinding. The TrustedAccessRoleBinding is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.TrustedAccessRoleBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + + _request = build_trusted_access_role_bindings_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TrustedAccessRoleBinding, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(trusted_access_role_binding, (IOBase, bytes)): + _content = trusted_access_role_binding + else: + _content = json.dumps(trusted_access_role_binding, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_trusted_access_role_bindings_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: _models.TrustedAccessRoleBinding, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + :param resource_group_name: The name of the resource group. The name is 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.models.TrustedAccessRoleBinding + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TrustedAccessRoleBinding. The + TrustedAccessRoleBinding is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TrustedAccessRoleBinding. The + TrustedAccessRoleBinding is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """Create or update a trusted access role binding. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :param trusted_access_role_binding: A trusted access role binding. Required. + :type trusted_access_role_binding: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns TrustedAccessRoleBinding. The + TrustedAccessRoleBinding is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + trusted_access_role_binding_name: str, + trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.TrustedAccessRoleBinding]: + """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 one of the following + types: TrustedAccessRoleBinding, JSON, IO[bytes] Required. + :type trusted_access_role_binding: ~azure.mgmt.containerservice.models.TrustedAccessRoleBinding + or JSON or IO[bytes] + :return: An instance of LROPoller that returns TrustedAccessRoleBinding. The + TrustedAccessRoleBinding is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + trusted_access_role_binding=trusted_access_role_binding, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.TrustedAccessRoleBinding, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.TrustedAccessRoleBinding].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.TrustedAccessRoleBinding]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_trusted_access_role_bindings_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a trusted access role binding. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param trusted_access_role_binding_name: The name of trusted access role binding. Required. + :type trusted_access_role_binding_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + trusted_access_role_binding_name=trusted_access_role_binding_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> ItemPaged["_models.TrustedAccessRoleBinding"]: + """List trusted access role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of TrustedAccessRoleBinding + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TrustedAccessRoleBinding]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_trusted_access_role_bindings_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TrustedAccessRoleBinding], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class LoadBalancersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`load_balancers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "load_balancer_name", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def get( + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> _models.LoadBalancer: + """Gets the specified load balancer. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: LoadBalancer. The LoadBalancer is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + _request = build_load_balancers_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LoadBalancer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + parameters: _models.LoadBalancer, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: The load balancer to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.LoadBalancer + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: LoadBalancer. The LoadBalancer is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: The load balancer to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: LoadBalancer. The LoadBalancer is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: The load balancer to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: LoadBalancer. The LoadBalancer is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "load_balancer_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def create_or_update( + self, + resource_group_name: str, + resource_name: str, + load_balancer_name: str, + parameters: Union[_models.LoadBalancer, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.LoadBalancer: + """Creates or updates a load balancer in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :param parameters: The load balancer to create or update. Is one of the following types: + LoadBalancer, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.LoadBalancer or JSON or IO[bytes] + :return: LoadBalancer. The LoadBalancer is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.LoadBalancer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LoadBalancer] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_load_balancers_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LoadBalancer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "load_balancer_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def _delete_initial( + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_load_balancers_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "load_balancer_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def begin_delete( + self, resource_group_name: str, resource_name: str, load_balancer_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a load balancer in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param load_balancer_name: The name of the load balancer. Required. + :type load_balancer_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + load_balancer_name=load_balancer_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> ItemPaged["_models.LoadBalancer"]: + """Gets a list of load balancers in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of LoadBalancer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.LoadBalancer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LoadBalancer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_load_balancers_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LoadBalancer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class IdentityBindingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`identity_bindings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "identity_binding_name", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def get( + self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any + ) -> _models.IdentityBinding: + """Gets the specified Identity 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :return: IdentityBinding. The IdentityBinding is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.IdentityBinding + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IdentityBinding] = kwargs.pop("cls", None) + + _request = build_identity_bindings_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + identity_binding_name=identity_binding_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IdentityBinding, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "identity_binding_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + identity_binding_name: str, + parameters: Union[_models.IdentityBinding, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_identity_bindings_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + identity_binding_name=identity_binding_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + identity_binding_name: str, + parameters: _models.IdentityBinding, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IdentityBinding]: + """Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :param parameters: The identity binding to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.IdentityBinding + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns IdentityBinding. The IdentityBinding is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.IdentityBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + identity_binding_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IdentityBinding]: + """Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :param parameters: The identity binding to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns IdentityBinding. The IdentityBinding is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.IdentityBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + identity_binding_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.IdentityBinding]: + """Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :param parameters: The identity binding to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns IdentityBinding. The IdentityBinding is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.IdentityBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "identity_binding_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + identity_binding_name: str, + parameters: Union[_models.IdentityBinding, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.IdentityBinding]: + """Creates or updates an identity binding 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :param parameters: The identity binding to create or update. Is one of the following types: + IdentityBinding, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.IdentityBinding or JSON or IO[bytes] + :return: An instance of LROPoller that returns IdentityBinding. The IdentityBinding is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.IdentityBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IdentityBinding] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + identity_binding_name=identity_binding_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.IdentityBinding, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.IdentityBinding].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.IdentityBinding]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "identity_binding_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def _delete_initial( + self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_identity_bindings_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + identity_binding_name=identity_binding_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "identity_binding_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def begin_delete( + self, resource_group_name: str, resource_name: str, identity_binding_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes an identity binding 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 identity_binding_name: The name of the identity binding. Required. + :type identity_binding_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + identity_binding_name=identity_binding_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> ItemPaged["_models.IdentityBinding"]: + """Gets a list of identity bindings in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of IdentityBinding + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.IdentityBinding] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IdentityBinding]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_identity_bindings_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IdentityBinding], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JWTAuthenticatorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`jwt_authenticators` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "jwt_authenticator_name", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def get( + self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any + ) -> _models.JWTAuthenticator: + """Gets the specified JWT authenticator 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 jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :return: JWTAuthenticator. The JWTAuthenticator is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.JWTAuthenticator + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JWTAuthenticator] = kwargs.pop("cls", None) + + _request = build_jwt_authenticators_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + jwt_authenticator_name=jwt_authenticator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JWTAuthenticator, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "jwt_authenticator_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + jwt_authenticator_name: str, + parameters: Union[_models.JWTAuthenticator, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jwt_authenticators_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + jwt_authenticator_name=jwt_authenticator_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + jwt_authenticator_name: str, + parameters: _models.JWTAuthenticator, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JWTAuthenticator]: + """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to + apply the settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :param parameters: The JWT authenticator to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.JWTAuthenticator + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns JWTAuthenticator. The JWTAuthenticator is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + jwt_authenticator_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JWTAuthenticator]: + """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to + apply the settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :param parameters: The JWT authenticator to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns JWTAuthenticator. The JWTAuthenticator is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + jwt_authenticator_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JWTAuthenticator]: + """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to + apply the settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :param parameters: The JWT authenticator to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns JWTAuthenticator. The JWTAuthenticator is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "jwt_authenticator_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + jwt_authenticator_name: str, + parameters: Union[_models.JWTAuthenticator, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.JWTAuthenticator]: + """Creates or updates JWT authenticator in the managed cluster and updates the managed cluster to + apply the settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :param parameters: The JWT authenticator to create or update. Is one of the following types: + JWTAuthenticator, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.JWTAuthenticator or JSON or IO[bytes] + :return: An instance of LROPoller that returns JWTAuthenticator. The JWTAuthenticator is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.JWTAuthenticator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JWTAuthenticator] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + jwt_authenticator_name=jwt_authenticator_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JWTAuthenticator, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JWTAuthenticator].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JWTAuthenticator]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "jwt_authenticator_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def _delete_initial( + self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_jwt_authenticators_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + jwt_authenticator_name=jwt_authenticator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "jwt_authenticator_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def begin_delete( + self, resource_group_name: str, resource_name: str, jwt_authenticator_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a JWT authenticator and updates the managed cluster to apply the settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param jwt_authenticator_name: The name of the JWT authenticator. Required. + :type jwt_authenticator_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + jwt_authenticator_name=jwt_authenticator_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> ItemPaged["_models.JWTAuthenticator"]: + """Gets a list of JWT authenticators in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of JWTAuthenticator + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.JWTAuthenticator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JWTAuthenticator]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_jwt_authenticators_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JWTAuthenticator], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class MeshMembershipsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`mesh_memberships` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "mesh_membership_name", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def get( + self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any + ) -> _models.MeshMembership: + """Gets the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :return: MeshMembership. The MeshMembership is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.MeshMembership + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MeshMembership] = kwargs.pop("cls", None) + + _request = build_mesh_memberships_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mesh_membership_name=mesh_membership_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MeshMembership, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "mesh_membership_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def _create_or_update_initial( + self, + resource_group_name: str, + resource_name: str, + mesh_membership_name: str, + parameters: Union[_models.MeshMembership, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_mesh_memberships_create_or_update_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mesh_membership_name=mesh_membership_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + mesh_membership_name: str, + parameters: _models.MeshMembership, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MeshMembership]: + """Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :param parameters: The mesh membership to create or update. Required. + :type parameters: ~azure.mgmt.containerservice.models.MeshMembership + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MeshMembership. The MeshMembership is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.MeshMembership] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + mesh_membership_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MeshMembership]: + """Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :param parameters: The mesh membership to create or update. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MeshMembership. The MeshMembership is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.MeshMembership] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + mesh_membership_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.MeshMembership]: + """Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :param parameters: The mesh membership to create or update. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns MeshMembership. The MeshMembership is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.MeshMembership] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "mesh_membership_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def begin_create_or_update( + self, + resource_group_name: str, + resource_name: str, + mesh_membership_name: str, + parameters: Union[_models.MeshMembership, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.MeshMembership]: + """Creates or updates the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :param parameters: The mesh membership to create or update. Is one of the following types: + MeshMembership, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.MeshMembership or JSON or IO[bytes] + :return: An instance of LROPoller that returns MeshMembership. The MeshMembership is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.MeshMembership] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.MeshMembership] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + mesh_membership_name=mesh_membership_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.MeshMembership, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.MeshMembership].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.MeshMembership]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "mesh_membership_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def _delete_initial( + self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_mesh_memberships_delete_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + mesh_membership_name=mesh_membership_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "mesh_membership_name", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def begin_delete( + self, resource_group_name: str, resource_name: str, mesh_membership_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the mesh membership 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 mesh_membership_name: The name of the mesh membership. Required. + :type mesh_membership_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + mesh_membership_name=mesh_membership_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def list_by_managed_cluster( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> ItemPaged["_models.MeshMembership"]: + """Lists mesh memberships in a managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of MeshMembership + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.MeshMembership] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.MeshMembership]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_mesh_memberships_list_by_managed_cluster_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.MeshMembership], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.OperationValue"]: + """Gets a list of operations. + + :return: An iterator like instance of OperationValue + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.OperationValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OperationValue]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OperationValue], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class OperationStatusResultOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`operation_status_result` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "agent_pool_name", + "operation_id", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def get_by_agent_pool( + self, resource_group_name: str, resource_name: str, agent_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified agent pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param agent_pool_name: The name of the agent pool. Required. + :type agent_pool_name: str + :param operation_id: The ID of an ongoing async operation. Required. + :type operation_id: str + :return: OperationStatusResult. The OperationStatusResult is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_operation_status_result_get_by_agent_pool_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + agent_pool_name=agent_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": ["api_version", "subscription_id", "resource_group_name", "resource_name", "accept"] + }, + api_versions_list=["2025-10-02-preview"], + ) + def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> ItemPaged["_models.OperationStatusResult"]: + """Gets a list of operations in the specified managedCluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: An iterator like instance of OperationStatusResult + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.OperationStatusResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OperationStatusResult]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + _request = build_operation_status_result_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request -class Operations: + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OperationStatusResult], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-02-preview", + params_added_on={ + "2025-10-02-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "resource_name", + "operation_id", + "accept", + ] + }, + api_versions_list=["2025-10-02-preview"], + ) + def get( + self, resource_group_name: str, resource_name: str, operation_id: str, **kwargs: Any + ) -> _models.OperationStatusResult: + """Get the status of a specific operation in the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param operation_id: The ID of an ongoing async operation. Required. + :type operation_id: str + :return: OperationStatusResult. The OperationStatusResult is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_operation_status_result_get_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class PrivateLinkResourcesOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`operations` attribute. + :attr:`private_link_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, resource_name: str, **kwargs: Any + ) -> _models.PrivateLinkResourcesListResult: + """Gets a list of private link resources in the specified managed cluster. + + To learn more about private clusters, see: + `https://docs.microsoft.com/azure/aks/private-clusters + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :return: PrivateLinkResourcesListResult. The PrivateLinkResourcesListResult is compatible with + MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResourcesListResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) + + _request = build_private_link_resources_list_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateLinkResourcesListResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ResolvePrivateLinkServiceIdOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`resolve_private_link_service_id` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @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. + + :param resource_group_name: The name of the resource group. The name is 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.models.PrivateLinkResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets the private link service ID for the specified managed cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. Required. + :type resource_name: str + :param parameters: Parameters required in order to resolve a private link service ID. Required. + :type parameters: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def post( + self, + resource_group_name: str, + resource_name: str, + parameters: Union[_models.PrivateLinkResource, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.PrivateLinkResource: + """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 one of + the following types: PrivateLinkResource, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.containerservice.models.PrivateLinkResource or JSON or IO[bytes] + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_resolve_private_link_service_id_post_request( + resource_group_name=resource_group_name, + resource_name=resource_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateLinkResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class TrustedAccessRolesOperations: """ + .. warning:: + **DO NOT** instantiate this class directly. - models = _models + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`trusted_access_roles` attribute. + """ def __init__(self, *args, **kwargs) -> None: input_args = list(args) @@ -76,20 +15822,134 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.OperationValue"]: - """Gets a list of operations. + def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.TrustedAccessRole"]: + """List supported trusted access roles. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of TrustedAccessRole + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.TrustedAccessRole] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - Gets a list of operations. + cls: ClsType[List[_models.TrustedAccessRole]] = kwargs.pop("cls", None) - :return: An iterator like instance of either OperationValue or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.OperationValue] + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_trusted_access_roles_list_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TrustedAccessRole], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ContainerServiceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s + :attr:`container_service` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_node_image_versions(self, location: str, **kwargs: Any) -> ItemPaged["_models.NodeImageVersion"]: + """Gets a list of supported NodeImage versions in the specified subscription. + + Only returns the latest version of each node image. For example there may be an + AKSUbuntu-1804gen2containerd-2024.01.26, but only AKSUbuntu-1804gen2containerd-2024.02.02 is + visible in this list. + + :param location: The name of the Azure region. Required. + :type location: str + :return: An iterator like instance of NodeImageVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.NodeImageVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.NodeImageVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -102,12 +15962,19 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.OperationValue"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_container_service_list_node_image_versions_request( + location=location, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -122,16 +15989,24 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NodeImageVersion], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -144,9 +16019,9 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( + error = _failsafe_deserialize( _models.ErrorResponse, - pipeline_response, + response, ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_patch.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_patch.py index 8bcb627aa475..87676c65a8f0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_patch.py +++ b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_patch.py @@ -7,9 +7,9 @@ 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 + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_private_endpoint_connections_operations.py deleted file mode 100644 index fd1392a8bfcd..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,641 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class PrivateEndpointConnectionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnectionListResult: - """Gets a list of private endpoint connections in the specified managed cluster. - - To learn more about private clusters, see: - https://docs.microsoft.com/azure/aks/private-clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: PrivateEndpointConnectionListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnectionListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Gets the specified private endpoint connection. - - To learn more about private clusters, see: - https://docs.microsoft.com/azure/aks/private-clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - parameters: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Updates a private endpoint connection. - - Updates a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param parameters: The updated private endpoint connection. Required. - :type parameters: ~azure.mgmt.containerservice.models.PrivateEndpointConnection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Updates a private endpoint connection. - - Updates a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param parameters: The updated private endpoint connection. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - resource_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Updates a private endpoint connection. - - Updates a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :param parameters: The updated private endpoint connection. Is either a - PrivateEndpointConnection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.PrivateEndpointConnection or IO[bytes] - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "PrivateEndpointConnection") - - _request = build_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, resource_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a private endpoint connection. - - Deletes a private endpoint connection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_private_link_resources_operations.py deleted file mode 100644 index 5202b9c4aa72..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,160 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateLinkResources", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class PrivateLinkResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`private_link_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> _models.PrivateLinkResourcesListResult: - """Gets a list of private link resources in the specified managed cluster. - - To learn more about private clusters, see: - https://docs.microsoft.com/azure/aks/private-clusters. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: PrivateLinkResourcesListResult or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResourcesListResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateLinkResourcesListResult] = kwargs.pop("cls", None) - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateLinkResourcesListResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_resolve_private_link_service_id_operations.py deleted file mode 100644 index b25ae0919cd1..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_resolve_private_link_service_id_operations.py +++ /dev/null @@ -1,240 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_post_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resolvePrivateLinkServiceId", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ResolvePrivateLinkServiceIdOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`resolve_private_link_service_id` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @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.models.PrivateLinkResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def post( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.PrivateLinkResource: - """Gets the private link service ID for the specified managed cluster. - - Gets the private link service ID for the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters required in order to resolve a private link service ID. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def post( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.PrivateLinkResource, IO[bytes]], - **kwargs: Any - ) -> _models.PrivateLinkResource: - """Gets the private link service ID for the specified managed cluster. - - Gets the private link service ID for the specified managed cluster. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters required in order to resolve a private link service ID. Is either - a PrivateLinkResource type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.PrivateLinkResource or IO[bytes] - :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.PrivateLinkResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "PrivateLinkResource") - - _request = build_post_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("PrivateLinkResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_snapshots_operations.py deleted file mode 100644 index b1f0218b5615..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_snapshots_operations.py +++ /dev/null @@ -1,841 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/snapshots") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_tags_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class SnapshotsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`snapshots` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Snapshot"]: - """Gets a list of snapshots in the specified subscription. - - Gets a list of snapshots in the specified subscription. - - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Snapshot"]: - """Lists snapshots in the specified subscription and resource group. - - Lists snapshots in the specified subscription and resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either Snapshot or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.Snapshot] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SnapshotListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SnapshotListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, resource_name: str, **kwargs: Any) -> _models.Snapshot: - """Gets a snapshot. - - Gets a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Snapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.Snapshot, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Snapshot: - """Creates or updates a snapshot. - - Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The snapshot to create or update. Required. - :type parameters: ~azure.mgmt.containerservice.models.Snapshot - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Snapshot: - """Creates or updates a snapshot. - - Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The snapshot to create or update. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.Snapshot, IO[bytes]], - **kwargs: Any - ) -> _models.Snapshot: - """Creates or updates a snapshot. - - Creates or updates a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: The snapshot to create or update. Is either a Snapshot type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.containerservice.models.Snapshot or IO[bytes] - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Snapshot") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Snapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: _models.TagsObject, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Snapshot: - """Updates tags on a snapshot. - - Updates tags on a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update snapshot Tags operation. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Snapshot: - """Updates tags on a snapshot. - - Updates tags on a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update snapshot Tags operation. Required. - :type parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update_tags( - self, - resource_group_name: str, - resource_name: str, - parameters: Union[_models.TagsObject, IO[bytes]], - **kwargs: Any - ) -> _models.Snapshot: - """Updates tags on a snapshot. - - Updates tags on a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param parameters: Parameters supplied to the Update snapshot Tags operation. Is either a - TagsObject type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.containerservice.models.TagsObject or IO[bytes] - :return: Snapshot or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.Snapshot - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Snapshot] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TagsObject") - - _request = build_update_tags_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("Snapshot", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> None: - """Deletes a snapshot. - - Deletes a snapshot. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_trusted_access_role_bindings_operations.py deleted file mode 100644 index 7a76cc0dcc99..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_trusted_access_role_bindings_operations.py +++ /dev/null @@ -1,756 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, resource_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "trustedAccessRoleBindingName": _SERIALIZER.url( - "trusted_access_role_binding_name", - trusted_access_role_binding_name, - "str", - max_length=24, - min_length=1, - pattern=r"^([A-Za-z0-9-])+$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "trustedAccessRoleBindingName": _SERIALIZER.url( - "trusted_access_role_binding_name", - trusted_access_role_binding_name, - "str", - max_length=24, - min_length=1, - pattern=r"^([A-Za-z0-9-])+$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "resourceName": _SERIALIZER.url( - "resource_name", - resource_name, - "str", - max_length=63, - min_length=1, - pattern=r"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$", - ), - "trustedAccessRoleBindingName": _SERIALIZER.url( - "trusted_access_role_binding_name", - trusted_access_role_binding_name, - "str", - max_length=24, - min_length=1, - pattern=r"^([A-Za-z0-9-])+$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class TrustedAccessRoleBindingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`trusted_access_role_bindings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, resource_name: str, **kwargs: Any - ) -> ItemPaged["_models.TrustedAccessRoleBinding"]: - """List trusted access role bindings. - - List trusted access role bindings. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :return: An iterator like instance of either TrustedAccessRoleBinding or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrustedAccessRoleBindingListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("TrustedAccessRoleBindingListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any - ) -> _models.TrustedAccessRoleBinding: - """Get a trusted access role binding. - - Get a trusted access role binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param trusted_access_role_binding_name: The name of trusted access role binding. Required. - :type trusted_access_role_binding_name: str - :return: TrustedAccessRoleBinding or the result of cls(response) - :rtype: ~azure.mgmt.containerservice.models.TrustedAccessRoleBinding - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - trusted_access_role_binding_name=trusted_access_role_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(trusted_access_role_binding, (IOBase, bytes)): - _content = trusted_access_role_binding - else: - _json = self._serialize.body(trusted_access_role_binding, "TrustedAccessRoleBinding") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - trusted_access_role_binding_name=trusted_access_role_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - trusted_access_role_binding: _models.TrustedAccessRoleBinding, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TrustedAccessRoleBinding]: - """Create or update a trusted access role binding. - - Create or update a trusted access role binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param trusted_access_role_binding_name: The name of trusted access role binding. Required. - :type trusted_access_role_binding_name: str - :param trusted_access_role_binding: A trusted access role binding. Required. - :type trusted_access_role_binding: ~azure.mgmt.containerservice.models.TrustedAccessRoleBinding - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either TrustedAccessRoleBinding or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - trusted_access_role_binding: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.TrustedAccessRoleBinding]: - """Create or update a trusted access role binding. - - Create or update a trusted access role binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param trusted_access_role_binding_name: The name of trusted access role binding. Required. - :type trusted_access_role_binding_name: str - :param trusted_access_role_binding: A trusted access role binding. Required. - :type trusted_access_role_binding: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either TrustedAccessRoleBinding or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - resource_name: str, - trusted_access_role_binding_name: str, - trusted_access_role_binding: Union[_models.TrustedAccessRoleBinding, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.TrustedAccessRoleBinding]: - """Create or update a trusted access role binding. - - Create or update a trusted access role binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param trusted_access_role_binding_name: The name of trusted access role binding. Required. - :type trusted_access_role_binding_name: str - :param trusted_access_role_binding: A trusted access role binding. Is either a - TrustedAccessRoleBinding type or a IO[bytes] type. Required. - :type trusted_access_role_binding: ~azure.mgmt.containerservice.models.TrustedAccessRoleBinding - or IO[bytes] - :return: An instance of LROPoller that returns either TrustedAccessRoleBinding or the result of - cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.containerservice.models.TrustedAccessRoleBinding] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.TrustedAccessRoleBinding] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - trusted_access_role_binding_name=trusted_access_role_binding_name, - trusted_access_role_binding=trusted_access_role_binding, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("TrustedAccessRoleBinding", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.TrustedAccessRoleBinding].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.TrustedAccessRoleBinding]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - resource_name=resource_name, - trusted_access_role_binding_name=trusted_access_role_binding_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, resource_name: str, trusted_access_role_binding_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a trusted access role binding. - - Delete a trusted access role binding. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param resource_name: The name of the managed cluster resource. Required. - :type resource_name: str - :param trusted_access_role_binding_name: The name of trusted access role binding. Required. - :type trusted_access_role_binding_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - resource_name=resource_name, - trusted_access_role_binding_name=trusted_access_role_binding_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_trusted_access_roles_operations.py deleted file mode 100644 index 198b66ec2744..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/_trusted_access_roles_operations.py +++ /dev/null @@ -1,168 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import ContainerServiceClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(location: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-10-02-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/trustedAccessRoles", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "location": _SERIALIZER.url("location", location, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class TrustedAccessRolesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.containerservice.ContainerServiceClient`'s - :attr:`trusted_access_roles` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: ContainerServiceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, location: str, **kwargs: Any) -> ItemPaged["_models.TrustedAccessRole"]: - """List supported trusted access roles. - - List supported trusted access roles. - - :param location: The name of the Azure region. Required. - :type location: str - :return: An iterator like instance of either TrustedAccessRole or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.containerservice.models.TrustedAccessRole] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TrustedAccessRoleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - location=location, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("TrustedAccessRoleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/advanced_networking_transit_encryption.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/advanced_networking_transit_encryption.py index 843f126133fa..b35de58d2b10 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/advanced_networking_transit_encryption.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/advanced_networking_transit_encryption.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -79,6 +78,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AdvancedNetworkingTransitEncryption.json +# x-ms-original-file: 2025-10-02-preview/AdvancedNetworkingTransitEncryption.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_abort_operation.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_abort_operation.py index 427a36952652..568cbf2b9c4f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_abort_operation.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_abort_operation.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.agent_pools.begin_abort_latest_operation( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsAbortOperation.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsAbortOperation.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_associate_crg.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_associate_crg.py index 404c5031239b..a893edf9f011 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_associate_crg.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_associate_crg.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsAssociate_CRG.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsAssociate_CRG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_complete_upgrade.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_complete_upgrade.py index 260cc69f9899..1ca8c145b41d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_complete_upgrade.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_complete_upgrade.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.agent_pools.begin_complete_upgrade( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCompleteUpgrade.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCompleteUpgrade.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_custom_node_config.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_custom_node_config.py index 7cecb44a2dd0..5d242c99ae8f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_custom_node_config.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_custom_node_config.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -68,6 +67,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_CustomNodeConfig.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_CustomNodeConfig.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_dedicated_host_group.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_dedicated_host_group.py index cdd318f6b2d4..95e59f7cf943 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_dedicated_host_group.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_dedicated_host_group.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_DedicatedHostGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_encryption_at_host.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_encryption_at_host.py index 0fcae481fb00..db2ceee8bb59 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_encryption_at_host.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_encryption_at_host.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_EnableEncryptionAtHost.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_EnableEncryptionAtHost.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_fips.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_fips.py index 30bb1bddaac5..e442c1dd620f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_fips.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_fips.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_EnableFIPS.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_EnableFIPS.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_ultra_ssd.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_ultra_ssd.py index 232802f3713f..a161f3943b76 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_ultra_ssd.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_enable_ultra_ssd.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_EnableUltraSSD.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_EnableUltraSSD.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ephemeral.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ephemeral.py index b783ed5b06db..b350a18e8bf5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ephemeral.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ephemeral.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -49,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_Ephemeral.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_Ephemeral.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_gpumig.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_gpumig.py index 2c0a3766fb66..555d4e26332a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_gpumig.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_gpumig.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -69,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_GPUMIG.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_GPUMIG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_message_of_the_day.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_message_of_the_day.py index ba2ee2539888..f7a666eac652 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_message_of_the_day.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_message_of_the_day.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -50,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_MessageOfTheDay.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_MessageOfTheDay.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ossku.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ossku.py index 77abd85e51ad..f4ccab5548e6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ossku.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ossku.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -69,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_OSSKU.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_OSSKU.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ppg.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ppg.py index 98c7ddb093c2..1b274dd2ad5d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ppg.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_ppg.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_PPG.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_PPG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_snapshot.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_snapshot.py index f8cc497b46d6..b6529fc68f0a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_snapshot.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_snapshot.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_Snapshot.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_Snapshot.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_spot.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_spot.py index dbfc02384989..0b59767e25be 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_spot.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_spot.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -52,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_Spot.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_Spot.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines.py index becb06f7491f..2faa5942e268 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -54,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_TypeVirtualMachines.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_TypeVirtualMachines.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines_autoscale.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines_autoscale.py index 982f5c7834e9..09de76d16408 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines_autoscale.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_type_virtual_machines_autoscale.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -52,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_TypeVirtualMachines_Autoscale.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_TypeVirtualMachines_Autoscale.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_update.py index 09908a61fce6..8f9c7af89171 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_update.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -53,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_Update.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_wasm_wasi.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_wasm_wasi.py index 393fe611bf17..51534002eb3f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_wasm_wasi.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_wasm_wasi.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -50,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_WasmWasi.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_WasmWasi.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_disable_outbound_nat.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_disable_outbound_nat.py index 704232b26864..4de7b39a792c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_disable_outbound_nat.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_disable_outbound_nat.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -49,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_WindowsDisableOutboundNAT.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_WindowsDisableOutboundNAT.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_ossku.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_ossku.py index 86fa1176cf23..7cfcae8c6519 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_ossku.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_create_windows_ossku.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsCreate_WindowsOSSKU.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsCreate_WindowsOSSKU.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete.py index 39a0cd6cdb97..48beae238ef3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.agent_pools.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsDelete.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_ignore_pod_disruption_budget.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_ignore_pod_disruption_budget.py index 9f0cfaa67b06..63edb81a82d2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_ignore_pod_disruption_budget.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_ignore_pod_disruption_budget.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.agent_pools.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsDelete_IgnorePodDisruptionBudget.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_machines.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_machines.py index 06b7af7c2344..debb13c45a91 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_machines.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_delete_machines.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.agent_pools.begin_delete_machines( @@ -39,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsDeleteMachines.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsDeleteMachines.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get.py index b3d2d33bfc66..5446c282288c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsGet.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_agent_pool_available_versions.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_agent_pool_available_versions.py index b798b3880064..aefc6daa661e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_agent_pool_available_versions.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_agent_pool_available_versions.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.get_available_agent_pool_versions( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsGetAgentPoolAvailableVersions.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_upgrade_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_upgrade_profile.py index 36c7932c4e5e..39cc688d773c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_upgrade_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_get_upgrade_profile.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.get_upgrade_profile( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsGetUpgradeProfile.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsGetUpgradeProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_list.py index 4f251c59b9e8..35007a77b0f1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.list( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsList.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_start.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_start.py index 64ec2cb5dfa7..0b5a937d014b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_start.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_start.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPools_Start.json +# x-ms-original-file: 2025-10-02-preview/AgentPools_Start.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_stop.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_stop.py index bc5246a69be8..7487772fff8b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_stop.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_stop.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPools_Stop.json +# x-ms-original-file: 2025-10-02-preview/AgentPools_Stop.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_update.py index 19f7eaab6ed4..401f48eacd86 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_update.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.agent_pools.begin_create_or_update( @@ -53,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPools_Update.json +# x-ms-original-file: 2025-10-02-preview/AgentPools_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_upgrade_node_image_version.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_upgrade_node_image_version.py index 3653c6aadac8..fa1ef8933bdb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_upgrade_node_image_version.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/agent_pools_upgrade_node_image_version.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,17 +27,16 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.agent_pools.begin_upgrade_node_image_version( + client.agent_pools.begin_upgrade_node_image_version( resource_group_name="rg1", resource_name="clustername1", agent_pool_name="agentpool1", ).result() - print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json +# x-ms-original-file: 2025-10-02-preview/AgentPoolsUpgradeNodeImageVersion.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_guardrails_versions.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_guardrails_versions.py index bec42c191aab..e60a9c6f4bfa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_guardrails_versions.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_guardrails_versions.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.get_guardrails_versions( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/GetGuardrailsVersions.json +# x-ms-original-file: 2025-10-02-preview/GetGuardrailsVersions.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_safeguards_versions.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_safeguards_versions.py index 92a3b78dfba4..54d1aebeef4f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_safeguards_versions.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/get_safeguards_versions.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.get_safeguards_versions( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/GetSafeguardsVersions.json +# x-ms-original-file: 2025-10-02-preview/GetSafeguardsVersions.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_create_or_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_create_or_update.py index e26f9b9b2203..53e6de552805 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_create_or_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_create_or_update.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.identity_bindings.begin_create_or_update( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/IdentityBindings_Create_Or_Update.json +# x-ms-original-file: 2025-10-02-preview/IdentityBindings_Create_Or_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_delete.py index 1e25e008ca22..af2d18551ff5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.identity_bindings.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/IdentityBindings_Delete.json +# x-ms-original-file: 2025-10-02-preview/IdentityBindings_Delete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_get.py index 8329d958350e..b143c96284a5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.identity_bindings.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/IdentityBindings_Get.json +# x-ms-original-file: 2025-10-02-preview/IdentityBindings_Get.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_list.py index aac5d838dfd8..dc68c71e5702 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/identity_bindings_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.identity_bindings.list_by_managed_cluster( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/IdentityBindings_List.json +# x-ms-original-file: 2025-10-02-preview/IdentityBindings_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_create_or_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_create_or_update.py index 4ddd367d2744..1c31e30e4a6c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_create_or_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_create_or_update.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.jwt_authenticators.begin_create_or_update( @@ -62,6 +61,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/JWTAuthenticators_Create_Or_Update.json +# x-ms-original-file: 2025-10-02-preview/JWTAuthenticators_Create_Or_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_delete.py index 84d7bc36d680..bc45e364871c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.jwt_authenticators.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/JWTAuthenticators_Delete.json +# x-ms-original-file: 2025-10-02-preview/JWTAuthenticators_Delete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_get.py index 641799a098cf..916df760a78e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.jwt_authenticators.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/JWTAuthenticators_Get.json +# x-ms-original-file: 2025-10-02-preview/JWTAuthenticators_Get.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_list.py index 30626de048fc..162cf472d010 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/jwt_authenticators_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.jwt_authenticators.list_by_managed_cluster( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/JWTAuthenticators_List.json +# x-ms-original-file: 2025-10-02-preview/JWTAuthenticators_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/kubernetes_versions_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/kubernetes_versions_list.py index 1b1d32570866..fa8f4e3e298a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/kubernetes_versions_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/kubernetes_versions_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.list_kubernetes_versions( @@ -37,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/KubernetesVersions_List.json +# x-ms-original-file: 2025-10-02-preview/KubernetesVersions_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_guardrails_versions.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_guardrails_versions.py index 06cf84e172ee..e7896e61e782 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_guardrails_versions.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_guardrails_versions.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.list_guardrails_versions( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ListGuardrailsVersions.json +# x-ms-original-file: 2025-10-02-preview/ListGuardrailsVersions.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_safeguards_versions.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_safeguards_versions.py index a65b9cdbde17..fcaac2f3a2c9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_safeguards_versions.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/list_safeguards_versions.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.list_safeguards_versions( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ListSafeguardsVersions.json +# x-ms-original-file: 2025-10-02-preview/ListSafeguardsVersions.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_create_or_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_create_or_update.py index c8bd2d57b3bc..763da3be590d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_create_or_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_create_or_update.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.load_balancers.create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/LoadBalancers_Create_Or_Update.json +# x-ms-original-file: 2025-10-02-preview/LoadBalancers_Create_Or_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_delete.py index 79310e751893..c4cccab9a52f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.load_balancers.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/LoadBalancers_Delete.json +# x-ms-original-file: 2025-10-02-preview/LoadBalancers_Delete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_get.py index fc24ac0cf31b..17afbadaa469 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.load_balancers.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/LoadBalancers_Get.json +# x-ms-original-file: 2025-10-02-preview/LoadBalancers_Get.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_list.py index cb2b8caf1f9a..7582553cdda2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.load_balancers.list_by_managed_cluster( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/LoadBalancers_List.json +# x-ms-original-file: 2025-10-02-preview/LoadBalancers_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_rebalance.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_rebalance.py index e47d7c11ffe6..5a811a5ae11a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_rebalance.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/load_balancers_rebalance.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_clusters.begin_rebalance_load_balancers( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/LoadBalancers_Rebalance.json +# x-ms-original-file: 2025-10-02-preview/LoadBalancers_Rebalance.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_create_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_create_update.py index da6c77ec427d..bdda61623132 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_create_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_create_update.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.machines.begin_create_or_update( @@ -50,13 +49,12 @@ def main(): "operatingSystem": {"enableFIPS": False, "osSKU": "Ubuntu", "osType": "Linux"}, "priority": "Spot", "tags": {"name1": "val1"}, - }, - "zones": ["1"], + } }, ).result() print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MachineCreate_Update.json +# x-ms-original-file: 2025-10-02-preview/MachineCreate_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_get.py index 81083813d119..eabeb8606205 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.machines.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MachineGet.json +# x-ms-original-file: 2025-10-02-preview/MachineGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_list.py index 6ce7bc668180..0076702ea03e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/machine_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.machines.list( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MachineList.json +# x-ms-original-file: 2025-10-02-preview/MachineList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update_maintenance_window.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update_maintenance_window.py index 2d8ee515eb10..b79eef7dfc40 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update_maintenance_window.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_create_update_maintenance_window.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.maintenance_configurations.create_or_update( @@ -54,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json +# x-ms-original-file: 2025-10-02-preview/MaintenanceConfigurationsCreate_Update_MaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete_maintenance_window.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete_maintenance_window.py index 7d7c130add53..220249e29f84 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete_maintenance_window.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_delete_maintenance_window.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.maintenance_configurations.delete( @@ -38,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MaintenanceConfigurationsDelete_MaintenanceWindow.json +# x-ms-original-file: 2025-10-02-preview/MaintenanceConfigurationsDelete_MaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get_maintenance_window.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get_maintenance_window.py index 3b8a8d82a3b4..f1f23922f24e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get_maintenance_window.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_get_maintenance_window.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.maintenance_configurations.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MaintenanceConfigurationsGet_MaintenanceWindow.json +# x-ms-original-file: 2025-10-02-preview/MaintenanceConfigurationsGet_MaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list_maintenance_window.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list_maintenance_window.py index 68fa4d5b4875..3cf97a698702 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list_maintenance_window.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/maintenance_configurations_list_maintenance_window.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.maintenance_configurations.list_by_managed_cluster( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MaintenanceConfigurationsList_MaintenanceWindow.json +# x-ms-original-file: 2025-10-02-preview/MaintenanceConfigurationsList_MaintenanceWindow.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_create.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_create.py index e9d086128c51..db091ca75bd1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_create.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_create.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_cluster_snapshots.create_or_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClusterSnapshotsCreate.json +# x-ms-original-file: 2025-10-02-preview/ManagedClusterSnapshotsCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_delete.py index 57442e5de91d..6262d60a95ab 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_cluster_snapshots.delete( @@ -37,6 +36,6 @@ def main(): ) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClusterSnapshotsDelete.json +# x-ms-original-file: 2025-10-02-preview/ManagedClusterSnapshotsDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_get.py index 627c4613c429..ff35735d89f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_cluster_snapshots.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClusterSnapshotsGet.json +# x-ms-original-file: 2025-10-02-preview/ManagedClusterSnapshotsGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list.py index 670dad454644..1e24d796f7a1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_cluster_snapshots.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClusterSnapshotsList.json +# x-ms-original-file: 2025-10-02-preview/ManagedClusterSnapshotsList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list_by_resource_group.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list_by_resource_group.py index bb56737bba87..dfdb09342442 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list_by_resource_group.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_list_by_resource_group.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_cluster_snapshots.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json +# x-ms-original-file: 2025-10-02-preview/ManagedClusterSnapshotsListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_update_tags.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_update_tags.py index e512df1bd475..88bc1d595424 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_update_tags.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_cluster_snapshots_update_tags.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_cluster_snapshots.update_tags( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json +# x-ms-original-file: 2025-10-02-preview/ManagedClusterSnapshotsUpdateTags.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_abort_operation.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_abort_operation.py index 024b07fe04f0..9504ef9fb052 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_abort_operation.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_abort_operation.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_clusters.begin_abort_latest_operation( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersAbortOperation.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersAbortOperation.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_associate_crg.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_associate_crg.py index 6c72e6a06b73..c9cd59c08d97 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_associate_crg.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_associate_crg.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersAssociate_CRG.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersAssociate_CRG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_keyvault_secrets_provider.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_keyvault_secrets_provider.py index 9ce4cd5b0c3f..3dc894d7c483 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_keyvault_secrets_provider.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_keyvault_secrets_provider.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -75,6 +75,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_AzureKeyvaultSecretsProvider.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_service_mesh.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_service_mesh.py index 95d3f15e4c34..b7574e36cad2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_service_mesh.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_azure_service_mesh.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -93,6 +93,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_AzureServiceMesh.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_AzureServiceMesh.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_custom_ca_trust_certificates.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_custom_ca_trust_certificates.py index 6add57707d16..86ef14298cff 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_custom_ca_trust_certificates.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_custom_ca_trust_certificates.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -73,6 +73,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_CustomCATrustCertificates.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_CustomCATrustCertificates.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dedicated_host_group.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dedicated_host_group.py index 7bd95855c339..d1dc5dcdcf16 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dedicated_host_group.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dedicated_host_group.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -70,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_DedicatedHostGroup.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_DedicatedHostGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_disable_run_command.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_disable_run_command.py index 33a378d9d4c8..ab1c099b5e7c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_disable_run_command.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_disable_run_command.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -71,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_DisableRunCommand.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_DisableRunCommand.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dual_stack_networking.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dual_stack_networking.py index 51ed24a0e268..809907970fab 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dual_stack_networking.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_dual_stack_networking.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -87,6 +87,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_DualStackNetworking.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ai_toolchain_operator.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ai_toolchain_operator.py index c57a7a674bb0..7ee8965c892c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ai_toolchain_operator.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ai_toolchain_operator.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -71,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_EnableAIToolchainOperator.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_EnableAIToolchainOperator.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_encryption_at_host.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_encryption_at_host.py index 1508170c8f13..175b6f2dbcd3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_encryption_at_host.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_encryption_at_host.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_EnableEncryptionAtHost.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_EnableEncryptionAtHost.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ultra_ssd.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ultra_ssd.py index ad03c3093b4a..af5f8e318aee 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ultra_ssd.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enable_ultra_ssd.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_EnableUltraSSD.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_EnableUltraSSD.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enabled_fips.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enabled_fips.py index f3f44d22c6c7..4396f5c724d4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enabled_fips.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_enabled_fips.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_EnabledFIPS.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_EnabledFIPS.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_gpumig.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_gpumig.py index 27d36370acb5..d914946160da 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_gpumig.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_gpumig.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -77,6 +77,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_GPUMIG.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_GPUMIG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_httpproxy.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_httpproxy.py index ecaa2af3c48d..6abe82664bfa 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_httpproxy.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_httpproxy.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -76,6 +76,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_HTTPProxy.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_HTTPProxy.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_application_load_balancer.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_application_load_balancer.py index d246e174bc6b..2109da73469d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_application_load_balancer.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_application_load_balancer.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -65,6 +64,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_IngressProfile_ApplicationLoadBalancer.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_IngressProfile_ApplicationLoadBalancer.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_web_app_routing.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_web_app_routing.py index 9c50898c9d2c..b7bb575c3d45 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_web_app_routing.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ingress_profile_web_app_routing.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_IngressProfile_WebAppRouting.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_managed_nat_gateway.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_managed_nat_gateway.py index 92451c09a788..446524e68392 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_managed_nat_gateway.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_managed_nat_gateway.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -70,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_ManagedNATGateway.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_mcsnapshot.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_mcsnapshot.py index d1f0241bf0fa..d1779a3e235c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_mcsnapshot.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_mcsnapshot.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -64,6 +64,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_MCSnapshot.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_MCSnapshot.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_auto_provisioning.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_auto_provisioning.py index 527229e982a7..1f3ab3ef721d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_auto_provisioning.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_auto_provisioning.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -70,6 +69,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_NodeAutoProvisioning.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_NodeAutoProvisioning.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_public_ip_prefix.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_public_ip_prefix.py index 12a18d4425a0..1acdee2fecab 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_public_ip_prefix.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_node_public_ip_prefix.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_NodePublicIPPrefix.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_NodePublicIPPrefix.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ossku.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ossku.py index 8c145766217b..e3109a32c371 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ossku.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ossku.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -77,6 +77,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_OSSKU.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_OSSKU.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_pod_identity.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_pod_identity.py index c59a85cbe56c..6c1157a1ccd5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_pod_identity.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_pod_identity.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_PodIdentity.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_PodIdentity.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ppg.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ppg.py index ef997c60e4a6..7996d7bb4952 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ppg.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_ppg.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -71,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_PPG.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_PPG.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_premium.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_premium.py index 8b2f44305811..6f7b242d1cc6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_premium.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_premium.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -72,6 +71,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_Premium.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_Premium.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_fqdn_subdomain.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_fqdn_subdomain.py index e9a2b10d117c..7492de88d4b0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_fqdn_subdomain.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_fqdn_subdomain.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -74,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_public_fqdn.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_public_fqdn.py index ba5e66ab626e..e1ac4305bcbc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_public_fqdn.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_private_cluster_public_fqdn.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -71,6 +70,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_PrivateClusterPublicFQDN.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_security_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_security_profile.py index 0add9c65cf67..a760b5f20eed 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_security_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_security_profile.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -83,6 +83,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_SecurityProfile.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_SecurityProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_snapshot.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_snapshot.py index 34a415488762..dfe0f66146f6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_snapshot.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_snapshot.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -74,6 +74,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_Snapshot.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_Snapshot.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update.py index e312bf26986f..9a5a85d75518 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -87,6 +87,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_Update.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_windows_gmsa.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_windows_gmsa.py index 6b1557d01d00..1bd568d8ea76 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_windows_gmsa.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_windows_gmsa.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -81,6 +81,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_UpdateWindowsGmsa.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_UpdateWindowsGmsa.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_ahub.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_ahub.py index 7aecf252f163..ba7135e1263c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_ahub.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_ahub.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -81,6 +81,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_UpdateWithAHUB.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_UpdateWithAHUB.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_azure_rbac.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_azure_rbac.py index 50c96ef449cc..afed8ad727c7 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_azure_rbac.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_azure_rbac.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_namespace_resources.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_namespace_resources.py index 378e0800686b..8657b7cd19df 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_namespace_resources.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_update_with_enable_namespace_resources.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_UpdateWithEnableNamespaceResources.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_UpdateWithEnableNamespaceResources.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_user_assigned_nat_gateway.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_user_assigned_nat_gateway.py index a298ca1d36bf..59c4a52486b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_user_assigned_nat_gateway.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_user_assigned_nat_gateway.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -66,6 +66,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_UserAssignedNATGateway.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_virtual_machines.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_virtual_machines.py index 6b74136c5bcb..9a004f703b22 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_virtual_machines.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_create_virtual_machines.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_create_or_update( @@ -68,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersCreate_VirtualMachines.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersCreate_VirtualMachines.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_delete.py index 018691cda159..83a3ca39ec2c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_clusters.begin_delete( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersDelete.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get.py index e6daacabcc48..5289ef2382f1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersGet.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_access_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_access_profile.py index 6f9aec8e0491..26c5595945f9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_access_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_access_profile.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.get_access_profile( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersGetAccessProfile.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersGetAccessProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_revision_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_revision_profile.py index cfa42f3d5a05..0debda424296 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_revision_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_revision_profile.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.get_mesh_revision_profile( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersGet_MeshRevisionProfile.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersGet_MeshRevisionProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_upgrade_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_upgrade_profile.py index 9dd2ab8c2a27..ec640f22992a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_upgrade_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_mesh_upgrade_profile.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.get_mesh_upgrade_profile( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersGet_MeshUpgradeProfile.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersGet_MeshUpgradeProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_upgrade_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_upgrade_profile.py index 4d2d1bae518a..366c5bc2ecff 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_upgrade_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_get_upgrade_profile.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.get_upgrade_profile( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersGetUpgradeProfile.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersGetUpgradeProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list.py index b4053ea1f322..d1400d8ae00f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersList.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_by_resource_group.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_by_resource_group.py index 3c163f7fc68e..c16d236a2475 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_by_resource_group.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_by_resource_group.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersListByResourceGroup.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_admin_credentials.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_admin_credentials.py new file mode 100644 index 000000000000..323f8f73a720 --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_admin_credentials.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_clusters_list_cluster_admin_credentials.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.managed_clusters.list_cluster_admin_credentials( + resource_group_name="rg1", + resource_name="clustername1", + ) + print(response) + + +# x-ms-original-file: 2025-10-02-preview/ManagedClustersListClusterAdminCredentials.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_credential_result.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_credential_result.py index e437f334eae5..5402511a670e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_credential_result.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_credential_result.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,16 +27,16 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) - response = client.managed_clusters.list_cluster_admin_credentials( + response = client.managed_clusters.list_cluster_monitoring_user_credentials( resource_group_name="rg1", resource_name="clustername1", ) print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersListClusterCredentialResult.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersListClusterCredentialResult.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_user_credentials.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_user_credentials.py new file mode 100644 index 000000000000..1f96bd11131a --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_cluster_user_credentials.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.containerservice import ContainerServiceClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-containerservice +# USAGE + python managed_clusters_list_cluster_user_credentials.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ContainerServiceClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.managed_clusters.list_cluster_user_credentials( + resource_group_name="rg1", + resource_name="clustername1", + ) + print(response) + + +# x-ms-original-file: 2025-10-02-preview/ManagedClustersListClusterUserCredentials.json +if __name__ == "__main__": + main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_revision_profiles.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_revision_profiles.py index 6fc52bd49514..dfc214509604 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_revision_profiles.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_revision_profiles.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.list_mesh_revision_profiles( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersList_MeshRevisionProfiles.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersList_MeshRevisionProfiles.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_upgrade_profiles.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_upgrade_profiles.py index d705b69a3877..99f10ee48e2f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_upgrade_profiles.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_list_mesh_upgrade_profiles.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.list_mesh_upgrade_profiles( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersList_MeshUpgradeProfiles.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersList_MeshUpgradeProfiles.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_aad_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_aad_profile.py index b2e2c5c6386f..ac1a67315e05 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_aad_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_aad_profile.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_clusters.begin_reset_aad_profile( @@ -43,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersResetAADProfile.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersResetAADProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_service_principal_profile.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_service_principal_profile.py index e7fb381207f5..969fc26808ce 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_service_principal_profile.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_reset_service_principal_profile.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_clusters.begin_reset_service_principal_profile( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersResetServicePrincipalProfile.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_cluster_certificates.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_cluster_certificates.py index f84afedb06cc..3ca2ad4ba29f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_cluster_certificates.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_cluster_certificates.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_clusters.begin_rotate_cluster_certificates( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersRotateClusterCertificates.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersRotateClusterCertificates.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_service_account_signing_keys.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_service_account_signing_keys.py index 02835a3d05c0..59367b798a83 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_service_account_signing_keys.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_rotate_service_account_signing_keys.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_clusters.begin_rotate_service_account_signing_keys( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersRotateServiceAccountSigningKeys.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_start.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_start.py index 49bf8845a778..ca567c8a01cc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_start.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_start.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_clusters.begin_start( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersStart.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersStart.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_stop.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_stop.py index fd44c4527abf..7d06d57a995f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_stop.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_stop.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_clusters.begin_stop( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersStop.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersStop.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_update_tags.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_update_tags.py index 4a873bac54ad..0a9cd6dd306b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_update_tags.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_clusters_update_tags.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_update_tags( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedClustersUpdateTags.json +# x-ms-original-file: 2025-10-02-preview/ManagedClustersUpdateTags.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_create_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_create_update.py index f32d8a7238de..b90c03aec362 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_create_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_create_update.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_namespaces.begin_create_or_update( @@ -55,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedNamespacesCreate_Update.json +# x-ms-original-file: 2025-10-02-preview/ManagedNamespacesCreate_Update.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_delete.py index fba818d80455..6ba9baa73e2a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.managed_namespaces.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedNamespacesDelete.json +# x-ms-original-file: 2025-10-02-preview/ManagedNamespacesDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_get.py index b19af4084197..8ecea3c59cc9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_namespaces.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedNamespacesGet.json +# x-ms-original-file: 2025-10-02-preview/ManagedNamespacesGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_list.py index b8237c17eb14..c8f5fa4a109a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_namespaces.list_by_managed_cluster( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedNamespacesList.json +# x-ms-original-file: 2025-10-02-preview/ManagedNamespacesList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_list_credential_result.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_list_credential_result.py index bfade6007a99..92a5ba91fc37 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_list_credential_result.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_list_credential_result.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_namespaces.list_credential( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedNamespacesListCredentialResult.json +# x-ms-original-file: 2025-10-02-preview/ManagedNamespacesListCredentialResult.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_update_tags.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_update_tags.py index 0032e6e31e0b..dfac015d3974 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_update_tags.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/managed_namespaces_update_tags.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_namespaces.update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ManagedNamespacesUpdateTags.json +# x-ms-original-file: 2025-10-02-preview/ManagedNamespacesUpdateTags.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_create_or_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_create_or_update.py index 4d4b7e336b1b..0c6d6863836c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_create_or_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_create_or_update.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.mesh_memberships.begin_create_or_update( @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MeshMemberships_CreateOrUpdate.json +# x-ms-original-file: 2025-10-02-preview/MeshMemberships_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_delete.py index 7846f4b0fe44..d8e40df24151 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.mesh_memberships.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MeshMemberships_Delete.json +# x-ms-original-file: 2025-10-02-preview/MeshMemberships_Delete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_get.py index 12ab2a0e47f5..aead823349d3 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.mesh_memberships.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MeshMemberships_Get.json +# x-ms-original-file: 2025-10-02-preview/MeshMemberships_Get.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_list_by_managed_cluster.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_list_by_managed_cluster.py index e2688fea0df9..9307e080a113 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_list_by_managed_cluster.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/mesh_memberships_list_by_managed_cluster.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.mesh_memberships.list_by_managed_cluster( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/MeshMemberships_ListByManagedCluster.json +# x-ms-original-file: 2025-10-02-preview/MeshMemberships_ListByManagedCluster.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/node_image_versions_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/node_image_versions_list.py index 8ac95862dbac..04384e5c42b1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/node_image_versions_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/node_image_versions_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.container_service.list_node_image_versions( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/NodeImageVersions_List.json +# x-ms-original-file: 2025-10-02-preview/NodeImageVersions_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_list.py index 610d0e6b8aad..824cc9f29646 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/Operation_List.json +# x-ms-original-file: 2025-10-02-preview/Operation_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get.py index 3203e55d56a7..81ea4e8a14d8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.operation_status_result.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/OperationStatusResultGet.json +# x-ms-original-file: 2025-10-02-preview/OperationStatusResultGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get_by_agent_pool.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get_by_agent_pool.py index e4efdfa72416..a1cb7f6b54a8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get_by_agent_pool.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_get_by_agent_pool.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.operation_status_result.get_by_agent_pool( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/OperationStatusResultGetByAgentPool.json +# x-ms-original-file: 2025-10-02-preview/OperationStatusResultGetByAgentPool.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_list.py index 1f08b2fe9a66..60303379ecc1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/operation_status_result_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.operation_status_result.list( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/OperationStatusResultList.json +# x-ms-original-file: 2025-10-02-preview/OperationStatusResultList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/outbound_network_dependencies_endpoints_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/outbound_network_dependencies_endpoints_list.py index 46148547ee50..54805441c69a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/outbound_network_dependencies_endpoints_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/outbound_network_dependencies_endpoints_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.list_outbound_network_dependencies_endpoints( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json +# x-ms-original-file: 2025-10-02-preview/OutboundNetworkDependenciesEndpointsList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_delete.py index bd495b7eaab5..f8b9a2bd3875 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.private_endpoint_connections.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/PrivateEndpointConnectionsDelete.json +# x-ms-original-file: 2025-10-02-preview/PrivateEndpointConnectionsDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_get.py index b6bc1803eabb..47458fc134b6 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.private_endpoint_connections.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/PrivateEndpointConnectionsGet.json +# x-ms-original-file: 2025-10-02-preview/PrivateEndpointConnectionsGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_list.py index 2a437d32eb0a..f02625e20733 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.private_endpoint_connections.list( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/PrivateEndpointConnectionsList.json +# x-ms-original-file: 2025-10-02-preview/PrivateEndpointConnectionsList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_update.py index b594afa7c0a1..70abce9e0761 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_endpoint_connections_update.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.private_endpoint_connections.update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/PrivateEndpointConnectionsUpdate.json +# x-ms-original-file: 2025-10-02-preview/PrivateEndpointConnectionsUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_link_resources_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_link_resources_list.py index 0de53dc84b1e..5ee767fea1bb 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_link_resources_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/private_link_resources_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.private_link_resources.list( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/PrivateLinkResourcesList.json +# x-ms-original-file: 2025-10-02-preview/PrivateLinkResourcesList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/resolve_private_link_service_id.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/resolve_private_link_service_id.py index 6ad482d1b331..1033d4988f44 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/resolve_private_link_service_id.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/resolve_private_link_service_id.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.resolve_private_link_service_id.post( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/ResolvePrivateLinkServiceId.json +# x-ms-original-file: 2025-10-02-preview/ResolvePrivateLinkServiceId.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_request.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_request.py index babbf6b4992e..62f01b09974c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_request.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_request.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.begin_run_command( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/RunCommandRequest.json +# x-ms-original-file: 2025-10-02-preview/RunCommandRequest.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_failed.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_failed.py index 004daa553672..a0cf4c8a2c52 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_failed.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_failed.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.get_command_result( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/RunCommandResultFailed.json +# x-ms-original-file: 2025-10-02-preview/RunCommandResultFailed.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_succeed.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_succeed.py index 78124254601b..cb680f77158d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_succeed.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/run_command_result_succeed.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_clusters.get_command_result( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/RunCommandResultSucceed.json +# x-ms-original-file: 2025-10-02-preview/RunCommandResultSucceed.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_create.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_create.py index 08606e4e5ebe..723dae24893a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_create.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_create.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.snapshots.create_or_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/SnapshotsCreate.json +# x-ms-original-file: 2025-10-02-preview/SnapshotsCreate.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_delete.py index fe27445d04c2..a6a66d710dbf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.snapshots.delete( @@ -37,6 +36,6 @@ def main(): ) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/SnapshotsDelete.json +# x-ms-original-file: 2025-10-02-preview/SnapshotsDelete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_get.py index 1d30381daef4..54151d797cc0 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.snapshots.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/SnapshotsGet.json +# x-ms-original-file: 2025-10-02-preview/SnapshotsGet.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list.py index 88f6b10f06d7..64f5e6a938e9 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.snapshots.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/SnapshotsList.json +# x-ms-original-file: 2025-10-02-preview/SnapshotsList.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list_by_resource_group.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list_by_resource_group.py index 3b61e5bc15fe..48062b4de149 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list_by_resource_group.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_list_by_resource_group.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.snapshots.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/SnapshotsListByResourceGroup.json +# x-ms-original-file: 2025-10-02-preview/SnapshotsListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_update_tags.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_update_tags.py index 50ba459034cf..7ecd8dd92e1d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_update_tags.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/snapshots_update_tags.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.snapshots.update_tags( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/SnapshotsUpdateTags.json +# x-ms-original-file: 2025-10-02-preview/SnapshotsUpdateTags.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_create_or_update.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_create_or_update.py index 2732ce13fbd1..5d740612d0ab 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_create_or_update.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_create_or_update.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +28,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.trusted_access_role_bindings.begin_create_or_update( @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/TrustedAccessRoleBindings_CreateOrUpdate.json +# x-ms-original-file: 2025-10-02-preview/TrustedAccessRoleBindings_CreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_delete.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_delete.py index 24cd8f51097d..c74122ffb6e5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_delete.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_delete.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) client.trusted_access_role_bindings.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/TrustedAccessRoleBindings_Delete.json +# x-ms-original-file: 2025-10-02-preview/TrustedAccessRoleBindings_Delete.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_get.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_get.py index 9fb0b15bd510..a25df4355533 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_get.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_get.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.trusted_access_role_bindings.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/TrustedAccessRoleBindings_Get.json +# x-ms-original-file: 2025-10-02-preview/TrustedAccessRoleBindings_Get.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_list.py index 03195673d918..4696dd440603 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_role_bindings_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.trusted_access_role_bindings.list( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/TrustedAccessRoleBindings_List.json +# x-ms-original-file: 2025-10-02-preview/TrustedAccessRoleBindings_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_roles_list.py b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_roles_list.py index c9089f34cf16..44a1807ec1c2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_roles_list.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_samples/trusted_access_roles_list.py @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -28,7 +27,7 @@ def main(): client = ContainerServiceClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="SUBSCRIPTION_ID", ) response = client.trusted_access_roles.list( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/preview/2025-10-02-preview/examples/TrustedAccessRoles_List.json +# x-ms-original-file: 2025-10-02-preview/TrustedAccessRoles_List.json if __name__ == "__main__": main() diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/conftest.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/conftest.py index 72cff9f15fb0..f44a317607d8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/conftest.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/conftest.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations.py index 71e85f29cd66..56a3f756f1b5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,31 +18,6 @@ class TestContainerServiceAgentPoolsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_agent_pools_begin_abort_latest_operation(self, resource_group): - response = self.client.agent_pools.begin_abort_latest_operation( - resource_group_name=resource_group.name, - resource_name="str", - agent_pool_name="str", - api_version="2025-10-02-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_agent_pools_list(self, resource_group): - response = self.client.agent_pools.list( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_agent_pools_get(self, resource_group): @@ -50,7 +25,6 @@ def test_agent_pools_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -64,172 +38,182 @@ def test_agent_pools_begin_create_or_update(self, resource_group): resource_name="str", agent_pool_name="str", parameters={ - "artifactStreamingProfile": {"enabled": bool}, - "availabilityZones": ["str"], - "capacityReservationGroupID": "str", - "count": 0, - "creationData": {"sourceResourceId": "str"}, - "currentOrchestratorVersion": "str", - "eTag": "str", - "enableAutoScaling": bool, - "enableEncryptionAtHost": bool, - "enableFIPS": bool, - "enableNodePublicIP": bool, - "enableUltraSSD": bool, - "gatewayProfile": {"publicIPPrefixSize": 31}, - "gpuInstanceProfile": "str", - "gpuProfile": {"driver": "str", "driverType": "str"}, - "hostGroupID": "str", "id": "str", - "kubeletConfig": { - "allowedUnsafeSysctls": ["str"], - "containerLogMaxFiles": 0, - "containerLogMaxSizeMB": 0, - "cpuCfsQuota": bool, - "cpuCfsQuotaPeriod": "str", - "cpuManagerPolicy": "str", - "failSwapOn": bool, - "imageGcHighThreshold": 0, - "imageGcLowThreshold": 0, - "podMaxPids": 0, - "seccompDefault": "str", - "topologyManagerPolicy": "str", - }, - "kubeletDiskType": "str", - "linuxOSConfig": { - "swapFileSizeMB": 0, - "sysctls": { - "fsAioMaxNr": 0, - "fsFileMax": 0, - "fsInotifyMaxUserWatches": 0, - "fsNrOpen": 0, - "kernelThreadsMax": 0, - "netCoreNetdevMaxBacklog": 0, - "netCoreOptmemMax": 0, - "netCoreRmemDefault": 0, - "netCoreRmemMax": 0, - "netCoreSomaxconn": 0, - "netCoreWmemDefault": 0, - "netCoreWmemMax": 0, - "netIpv4IpLocalPortRange": "str", - "netIpv4NeighDefaultGcThresh1": 0, - "netIpv4NeighDefaultGcThresh2": 0, - "netIpv4NeighDefaultGcThresh3": 0, - "netIpv4TcpFinTimeout": 0, - "netIpv4TcpKeepaliveProbes": 0, - "netIpv4TcpKeepaliveTime": 0, - "netIpv4TcpMaxSynBacklog": 0, - "netIpv4TcpMaxTwBuckets": 0, - "netIpv4TcpTwReuse": bool, - "netIpv4TcpkeepaliveIntvl": 0, - "netNetfilterNfConntrackBuckets": 0, - "netNetfilterNfConntrackMax": 0, - "vmMaxMapCount": 0, - "vmSwappiness": 0, - "vmVfsCachePressure": 0, + "name": "str", + "properties": { + "artifactStreamingProfile": {"enabled": bool}, + "availabilityZones": ["str"], + "capacityReservationGroupID": "str", + "count": 0, + "creationData": {"sourceResourceId": "str"}, + "currentOrchestratorVersion": "str", + "eTag": "str", + "enableAutoScaling": bool, + "enableEncryptionAtHost": bool, + "enableFIPS": bool, + "enableNodePublicIP": bool, + "enableUltraSSD": bool, + "gatewayProfile": {"publicIPPrefixSize": 0}, + "gpuInstanceProfile": "str", + "gpuProfile": {"driver": "str", "driverType": "str"}, + "hostGroupID": "str", + "kubeletConfig": { + "allowedUnsafeSysctls": ["str"], + "containerLogMaxFiles": 0, + "containerLogMaxSizeMB": 0, + "cpuCfsQuota": bool, + "cpuCfsQuotaPeriod": "str", + "cpuManagerPolicy": "str", + "failSwapOn": bool, + "imageGcHighThreshold": 0, + "imageGcLowThreshold": 0, + "podMaxPids": 0, + "seccompDefault": "str", + "topologyManagerPolicy": "str", }, - "transparentHugePageDefrag": "str", - "transparentHugePageEnabled": "str", - }, - "localDNSProfile": { - "kubeDNSOverrides": { - "str": { - "cacheDurationInSeconds": 3600, - "forwardDestination": "ClusterCoreDNS", - "forwardPolicy": "Sequential", - "maxConcurrent": 1000, - "protocol": "PreferUDP", - "queryLogging": "Error", - "serveStale": "Immediate", - "serveStaleDurationInSeconds": 3600, + "kubeletDiskType": "str", + "linuxOSConfig": { + "swapFileSizeMB": 0, + "sysctls": { + "fsAioMaxNr": 0, + "fsFileMax": 0, + "fsInotifyMaxUserWatches": 0, + "fsNrOpen": 0, + "kernelThreadsMax": 0, + "netCoreNetdevMaxBacklog": 0, + "netCoreOptmemMax": 0, + "netCoreRmemDefault": 0, + "netCoreRmemMax": 0, + "netCoreSomaxconn": 0, + "netCoreWmemDefault": 0, + "netCoreWmemMax": 0, + "netIpv4IpLocalPortRange": "str", + "netIpv4NeighDefaultGcThresh1": 0, + "netIpv4NeighDefaultGcThresh2": 0, + "netIpv4NeighDefaultGcThresh3": 0, + "netIpv4TcpFinTimeout": 0, + "netIpv4TcpKeepaliveProbes": 0, + "netIpv4TcpKeepaliveTime": 0, + "netIpv4TcpMaxSynBacklog": 0, + "netIpv4TcpMaxTwBuckets": 0, + "netIpv4TcpTwReuse": bool, + "netIpv4TcpkeepaliveIntvl": 0, + "netNetfilterNfConntrackBuckets": 0, + "netNetfilterNfConntrackMax": 0, + "vmMaxMapCount": 0, + "vmSwappiness": 0, + "vmVfsCachePressure": 0, + }, + "transparentHugePageDefrag": "str", + "transparentHugePageEnabled": "str", + }, + "localDNSProfile": { + "kubeDNSOverrides": { + "str": { + "cacheDurationInSeconds": 0, + "forwardDestination": "str", + "forwardPolicy": "str", + "maxConcurrent": 0, + "protocol": "str", + "queryLogging": "str", + "serveStale": "str", + "serveStaleDurationInSeconds": 0, + } + }, + "mode": "str", + "state": "str", + "vnetDNSOverrides": { + "str": { + "cacheDurationInSeconds": 0, + "forwardDestination": "str", + "forwardPolicy": "str", + "maxConcurrent": 0, + "protocol": "str", + "queryLogging": "str", + "serveStale": "str", + "serveStaleDurationInSeconds": 0, + } + }, + }, + "maxCount": 0, + "maxPods": 0, + "messageOfTheDay": "str", + "minCount": 0, + "mode": "str", + "networkProfile": { + "allowedHostPorts": [{"portEnd": 0, "portStart": 0, "protocol": "str"}], + "applicationSecurityGroups": ["str"], + "nodePublicIPTags": [{"ipTagType": "str", "tag": "str"}], + }, + "nodeCustomizationProfile": {"nodeCustomizationId": "str"}, + "nodeImageVersion": "str", + "nodeInitializationTaints": ["str"], + "nodeLabels": {"str": "str"}, + "nodePublicIPPrefixID": "str", + "nodeTaints": ["str"], + "orchestratorVersion": "str", + "osDiskSizeGB": 0, + "osDiskType": "str", + "osSKU": "str", + "osType": "str", + "podIPAllocationMode": "str", + "podSubnetID": "str", + "powerState": {"code": "str"}, + "provisioningState": "str", + "proximityPlacementGroupID": "str", + "scaleDownMode": "str", + "scaleSetEvictionPolicy": "str", + "scaleSetPriority": "str", + "securityProfile": {"enableSecureBoot": bool, "enableVTPM": bool, "sshAccess": "str"}, + "spotMaxPrice": 0.0, + "status": { + "provisioningError": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", } }, - "mode": "Preferred", - "state": "str", - "vnetDNSOverrides": { - "str": { - "cacheDurationInSeconds": 3600, - "forwardDestination": "ClusterCoreDNS", - "forwardPolicy": "Sequential", - "maxConcurrent": 1000, - "protocol": "PreferUDP", - "queryLogging": "Error", - "serveStale": "Immediate", - "serveStaleDurationInSeconds": 3600, + "tags": {"str": "str"}, + "type": "str", + "upgradeSettings": { + "drainTimeoutInMinutes": 0, + "maxBlockedNodes": "str", + "maxSurge": "str", + "maxUnavailable": "str", + "nodeSoakDurationInMinutes": 0, + "undrainableNodeBehavior": "str", + }, + "upgradeSettingsBlueGreen": { + "batchSoakDurationInMinutes": 0, + "drainBatchSize": "str", + "drainTimeoutInMinutes": 0, + "finalSoakDurationInMinutes": 0, + }, + "upgradeStrategy": "str", + "virtualMachineNodesStatus": [{"count": 0, "size": "str"}], + "virtualMachinesProfile": { + "scale": { + "autoscale": {"maxCount": 0, "minCount": 0, "size": "str"}, + "manual": [{"count": 0, "size": "str"}], } }, + "vmSize": "str", + "vnetSubnetID": "str", + "windowsProfile": {"disableOutboundNat": bool}, + "workloadRuntime": "str", }, - "maxCount": 0, - "maxPods": 0, - "messageOfTheDay": "str", - "minCount": 0, - "mode": "str", - "name": "str", - "networkProfile": { - "allowedHostPorts": [{"portEnd": 0, "portStart": 0, "protocol": "str"}], - "applicationSecurityGroups": ["str"], - "nodePublicIPTags": [{"ipTagType": "str", "tag": "str"}], + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, - "nodeCustomizationProfile": {"nodeCustomizationId": "str"}, - "nodeImageVersion": "str", - "nodeInitializationTaints": ["str"], - "nodeLabels": {"str": "str"}, - "nodePublicIPPrefixID": "str", - "nodeTaints": ["str"], - "orchestratorVersion": "str", - "osDiskSizeGB": 0, - "osDiskType": "str", - "osSKU": "str", - "osType": "Linux", - "podIPAllocationMode": "str", - "podSubnetID": "str", - "powerState": {"code": "str"}, - "provisioningState": "str", - "proximityPlacementGroupID": "str", - "scaleDownMode": "str", - "scaleSetEvictionPolicy": "Delete", - "scaleSetPriority": "Regular", - "securityProfile": {"enableSecureBoot": bool, "enableVTPM": bool, "sshAccess": "str"}, - "spotMaxPrice": -1, - "status": { - "provisioningError": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - } - }, - "tags": {"str": "str"}, "type": "str", - "upgradeSettings": { - "drainTimeoutInMinutes": 0, - "maxBlockedNodes": "str", - "maxSurge": "str", - "maxUnavailable": "str", - "nodeSoakDurationInMinutes": 0, - "undrainableNodeBehavior": "str", - }, - "upgradeSettingsBlueGreen": { - "batchSoakDurationInMinutes": 0, - "drainBatchSize": "str", - "drainTimeoutInMinutes": 0, - "finalSoakDurationInMinutes": 0, - }, - "upgradeStrategy": "str", - "virtualMachineNodesStatus": [{"count": 0, "size": "str"}], - "virtualMachinesProfile": { - "scale": { - "autoscale": {"maxCount": 0, "minCount": 0, "size": "str"}, - "manual": [{"count": 0, "size": "str"}], - } - }, - "vmSize": "str", - "vnetSubnetID": "str", - "windowsProfile": {"disableOutboundNat": bool}, - "workloadRuntime": "str", }, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -242,7 +226,6 @@ def test_agent_pools_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -250,13 +233,23 @@ def test_agent_pools_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_agent_pools_get_upgrade_profile(self, resource_group): - response = self.client.agent_pools.get_upgrade_profile( + def test_agent_pools_list(self, resource_group): + response = self.client.agent_pools.list( resource_group_name=resource_group.name, resource_name="str", - agent_pool_name="str", - api_version="2025-10-02-preview", ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_agent_pools_begin_abort_latest_operation(self, resource_group): + response = self.client.agent_pools.begin_abort_latest_operation( + resource_group_name=resource_group.name, + resource_name="str", + agent_pool_name="str", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @@ -268,7 +261,6 @@ def test_agent_pools_begin_complete_upgrade(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -282,7 +274,18 @@ def test_agent_pools_begin_delete_machines(self, resource_group): resource_name="str", agent_pool_name="str", machines={"machineNames": ["str"]}, - api_version="2025-10-02-preview", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_agent_pools_begin_upgrade_node_image_version(self, resource_group): + response = self.client.agent_pools.begin_upgrade_node_image_version( + resource_group_name=resource_group.name, + resource_name="str", + agent_pool_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -294,7 +297,6 @@ def test_agent_pools_get_available_agent_pool_versions(self, resource_group): response = self.client.agent_pools.get_available_agent_pool_versions( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -302,13 +304,12 @@ def test_agent_pools_get_available_agent_pool_versions(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_agent_pools_begin_upgrade_node_image_version(self, resource_group): - response = self.client.agent_pools.begin_upgrade_node_image_version( + def test_agent_pools_get_upgrade_profile(self, resource_group): + response = self.client.agent_pools.get_upgrade_profile( resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-10-02-preview", - ).result() # call '.result()' to poll until service return final result + ) # please add some check logic here by yourself # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations_async.py index 826832ea627b..1c4a0625de1b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_agent_pools_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,33 +19,6 @@ class TestContainerServiceAgentPoolsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_agent_pools_begin_abort_latest_operation(self, resource_group): - response = await ( - await self.client.agent_pools.begin_abort_latest_operation( - resource_group_name=resource_group.name, - resource_name="str", - agent_pool_name="str", - api_version="2025-10-02-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_agent_pools_list(self, resource_group): - response = self.client.agent_pools.list( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_agent_pools_get(self, resource_group): @@ -53,7 +26,6 @@ async def test_agent_pools_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -68,172 +40,182 @@ async def test_agent_pools_begin_create_or_update(self, resource_group): resource_name="str", agent_pool_name="str", parameters={ - "artifactStreamingProfile": {"enabled": bool}, - "availabilityZones": ["str"], - "capacityReservationGroupID": "str", - "count": 0, - "creationData": {"sourceResourceId": "str"}, - "currentOrchestratorVersion": "str", - "eTag": "str", - "enableAutoScaling": bool, - "enableEncryptionAtHost": bool, - "enableFIPS": bool, - "enableNodePublicIP": bool, - "enableUltraSSD": bool, - "gatewayProfile": {"publicIPPrefixSize": 31}, - "gpuInstanceProfile": "str", - "gpuProfile": {"driver": "str", "driverType": "str"}, - "hostGroupID": "str", "id": "str", - "kubeletConfig": { - "allowedUnsafeSysctls": ["str"], - "containerLogMaxFiles": 0, - "containerLogMaxSizeMB": 0, - "cpuCfsQuota": bool, - "cpuCfsQuotaPeriod": "str", - "cpuManagerPolicy": "str", - "failSwapOn": bool, - "imageGcHighThreshold": 0, - "imageGcLowThreshold": 0, - "podMaxPids": 0, - "seccompDefault": "str", - "topologyManagerPolicy": "str", - }, - "kubeletDiskType": "str", - "linuxOSConfig": { - "swapFileSizeMB": 0, - "sysctls": { - "fsAioMaxNr": 0, - "fsFileMax": 0, - "fsInotifyMaxUserWatches": 0, - "fsNrOpen": 0, - "kernelThreadsMax": 0, - "netCoreNetdevMaxBacklog": 0, - "netCoreOptmemMax": 0, - "netCoreRmemDefault": 0, - "netCoreRmemMax": 0, - "netCoreSomaxconn": 0, - "netCoreWmemDefault": 0, - "netCoreWmemMax": 0, - "netIpv4IpLocalPortRange": "str", - "netIpv4NeighDefaultGcThresh1": 0, - "netIpv4NeighDefaultGcThresh2": 0, - "netIpv4NeighDefaultGcThresh3": 0, - "netIpv4TcpFinTimeout": 0, - "netIpv4TcpKeepaliveProbes": 0, - "netIpv4TcpKeepaliveTime": 0, - "netIpv4TcpMaxSynBacklog": 0, - "netIpv4TcpMaxTwBuckets": 0, - "netIpv4TcpTwReuse": bool, - "netIpv4TcpkeepaliveIntvl": 0, - "netNetfilterNfConntrackBuckets": 0, - "netNetfilterNfConntrackMax": 0, - "vmMaxMapCount": 0, - "vmSwappiness": 0, - "vmVfsCachePressure": 0, + "name": "str", + "properties": { + "artifactStreamingProfile": {"enabled": bool}, + "availabilityZones": ["str"], + "capacityReservationGroupID": "str", + "count": 0, + "creationData": {"sourceResourceId": "str"}, + "currentOrchestratorVersion": "str", + "eTag": "str", + "enableAutoScaling": bool, + "enableEncryptionAtHost": bool, + "enableFIPS": bool, + "enableNodePublicIP": bool, + "enableUltraSSD": bool, + "gatewayProfile": {"publicIPPrefixSize": 0}, + "gpuInstanceProfile": "str", + "gpuProfile": {"driver": "str", "driverType": "str"}, + "hostGroupID": "str", + "kubeletConfig": { + "allowedUnsafeSysctls": ["str"], + "containerLogMaxFiles": 0, + "containerLogMaxSizeMB": 0, + "cpuCfsQuota": bool, + "cpuCfsQuotaPeriod": "str", + "cpuManagerPolicy": "str", + "failSwapOn": bool, + "imageGcHighThreshold": 0, + "imageGcLowThreshold": 0, + "podMaxPids": 0, + "seccompDefault": "str", + "topologyManagerPolicy": "str", }, - "transparentHugePageDefrag": "str", - "transparentHugePageEnabled": "str", - }, - "localDNSProfile": { - "kubeDNSOverrides": { - "str": { - "cacheDurationInSeconds": 3600, - "forwardDestination": "ClusterCoreDNS", - "forwardPolicy": "Sequential", - "maxConcurrent": 1000, - "protocol": "PreferUDP", - "queryLogging": "Error", - "serveStale": "Immediate", - "serveStaleDurationInSeconds": 3600, + "kubeletDiskType": "str", + "linuxOSConfig": { + "swapFileSizeMB": 0, + "sysctls": { + "fsAioMaxNr": 0, + "fsFileMax": 0, + "fsInotifyMaxUserWatches": 0, + "fsNrOpen": 0, + "kernelThreadsMax": 0, + "netCoreNetdevMaxBacklog": 0, + "netCoreOptmemMax": 0, + "netCoreRmemDefault": 0, + "netCoreRmemMax": 0, + "netCoreSomaxconn": 0, + "netCoreWmemDefault": 0, + "netCoreWmemMax": 0, + "netIpv4IpLocalPortRange": "str", + "netIpv4NeighDefaultGcThresh1": 0, + "netIpv4NeighDefaultGcThresh2": 0, + "netIpv4NeighDefaultGcThresh3": 0, + "netIpv4TcpFinTimeout": 0, + "netIpv4TcpKeepaliveProbes": 0, + "netIpv4TcpKeepaliveTime": 0, + "netIpv4TcpMaxSynBacklog": 0, + "netIpv4TcpMaxTwBuckets": 0, + "netIpv4TcpTwReuse": bool, + "netIpv4TcpkeepaliveIntvl": 0, + "netNetfilterNfConntrackBuckets": 0, + "netNetfilterNfConntrackMax": 0, + "vmMaxMapCount": 0, + "vmSwappiness": 0, + "vmVfsCachePressure": 0, + }, + "transparentHugePageDefrag": "str", + "transparentHugePageEnabled": "str", + }, + "localDNSProfile": { + "kubeDNSOverrides": { + "str": { + "cacheDurationInSeconds": 0, + "forwardDestination": "str", + "forwardPolicy": "str", + "maxConcurrent": 0, + "protocol": "str", + "queryLogging": "str", + "serveStale": "str", + "serveStaleDurationInSeconds": 0, + } + }, + "mode": "str", + "state": "str", + "vnetDNSOverrides": { + "str": { + "cacheDurationInSeconds": 0, + "forwardDestination": "str", + "forwardPolicy": "str", + "maxConcurrent": 0, + "protocol": "str", + "queryLogging": "str", + "serveStale": "str", + "serveStaleDurationInSeconds": 0, + } + }, + }, + "maxCount": 0, + "maxPods": 0, + "messageOfTheDay": "str", + "minCount": 0, + "mode": "str", + "networkProfile": { + "allowedHostPorts": [{"portEnd": 0, "portStart": 0, "protocol": "str"}], + "applicationSecurityGroups": ["str"], + "nodePublicIPTags": [{"ipTagType": "str", "tag": "str"}], + }, + "nodeCustomizationProfile": {"nodeCustomizationId": "str"}, + "nodeImageVersion": "str", + "nodeInitializationTaints": ["str"], + "nodeLabels": {"str": "str"}, + "nodePublicIPPrefixID": "str", + "nodeTaints": ["str"], + "orchestratorVersion": "str", + "osDiskSizeGB": 0, + "osDiskType": "str", + "osSKU": "str", + "osType": "str", + "podIPAllocationMode": "str", + "podSubnetID": "str", + "powerState": {"code": "str"}, + "provisioningState": "str", + "proximityPlacementGroupID": "str", + "scaleDownMode": "str", + "scaleSetEvictionPolicy": "str", + "scaleSetPriority": "str", + "securityProfile": {"enableSecureBoot": bool, "enableVTPM": bool, "sshAccess": "str"}, + "spotMaxPrice": 0.0, + "status": { + "provisioningError": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", } }, - "mode": "Preferred", - "state": "str", - "vnetDNSOverrides": { - "str": { - "cacheDurationInSeconds": 3600, - "forwardDestination": "ClusterCoreDNS", - "forwardPolicy": "Sequential", - "maxConcurrent": 1000, - "protocol": "PreferUDP", - "queryLogging": "Error", - "serveStale": "Immediate", - "serveStaleDurationInSeconds": 3600, + "tags": {"str": "str"}, + "type": "str", + "upgradeSettings": { + "drainTimeoutInMinutes": 0, + "maxBlockedNodes": "str", + "maxSurge": "str", + "maxUnavailable": "str", + "nodeSoakDurationInMinutes": 0, + "undrainableNodeBehavior": "str", + }, + "upgradeSettingsBlueGreen": { + "batchSoakDurationInMinutes": 0, + "drainBatchSize": "str", + "drainTimeoutInMinutes": 0, + "finalSoakDurationInMinutes": 0, + }, + "upgradeStrategy": "str", + "virtualMachineNodesStatus": [{"count": 0, "size": "str"}], + "virtualMachinesProfile": { + "scale": { + "autoscale": {"maxCount": 0, "minCount": 0, "size": "str"}, + "manual": [{"count": 0, "size": "str"}], } }, + "vmSize": "str", + "vnetSubnetID": "str", + "windowsProfile": {"disableOutboundNat": bool}, + "workloadRuntime": "str", }, - "maxCount": 0, - "maxPods": 0, - "messageOfTheDay": "str", - "minCount": 0, - "mode": "str", - "name": "str", - "networkProfile": { - "allowedHostPorts": [{"portEnd": 0, "portStart": 0, "protocol": "str"}], - "applicationSecurityGroups": ["str"], - "nodePublicIPTags": [{"ipTagType": "str", "tag": "str"}], - }, - "nodeCustomizationProfile": {"nodeCustomizationId": "str"}, - "nodeImageVersion": "str", - "nodeInitializationTaints": ["str"], - "nodeLabels": {"str": "str"}, - "nodePublicIPPrefixID": "str", - "nodeTaints": ["str"], - "orchestratorVersion": "str", - "osDiskSizeGB": 0, - "osDiskType": "str", - "osSKU": "str", - "osType": "Linux", - "podIPAllocationMode": "str", - "podSubnetID": "str", - "powerState": {"code": "str"}, - "provisioningState": "str", - "proximityPlacementGroupID": "str", - "scaleDownMode": "str", - "scaleSetEvictionPolicy": "Delete", - "scaleSetPriority": "Regular", - "securityProfile": {"enableSecureBoot": bool, "enableVTPM": bool, "sshAccess": "str"}, - "spotMaxPrice": -1, - "status": { - "provisioningError": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - } + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, - "tags": {"str": "str"}, "type": "str", - "upgradeSettings": { - "drainTimeoutInMinutes": 0, - "maxBlockedNodes": "str", - "maxSurge": "str", - "maxUnavailable": "str", - "nodeSoakDurationInMinutes": 0, - "undrainableNodeBehavior": "str", - }, - "upgradeSettingsBlueGreen": { - "batchSoakDurationInMinutes": 0, - "drainBatchSize": "str", - "drainTimeoutInMinutes": 0, - "finalSoakDurationInMinutes": 0, - }, - "upgradeStrategy": "str", - "virtualMachineNodesStatus": [{"count": 0, "size": "str"}], - "virtualMachinesProfile": { - "scale": { - "autoscale": {"maxCount": 0, "minCount": 0, "size": "str"}, - "manual": [{"count": 0, "size": "str"}], - } - }, - "vmSize": "str", - "vnetSubnetID": "str", - "windowsProfile": {"disableOutboundNat": bool}, - "workloadRuntime": "str", }, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -248,7 +230,6 @@ async def test_agent_pools_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -257,13 +238,25 @@ async def test_agent_pools_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_agent_pools_get_upgrade_profile(self, resource_group): - response = await self.client.agent_pools.get_upgrade_profile( + async def test_agent_pools_list(self, resource_group): + response = self.client.agent_pools.list( resource_group_name=resource_group.name, resource_name="str", - agent_pool_name="str", - api_version="2025-10-02-preview", ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_agent_pools_begin_abort_latest_operation(self, resource_group): + response = await ( + await self.client.agent_pools.begin_abort_latest_operation( + resource_group_name=resource_group.name, + resource_name="str", + agent_pool_name="str", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @@ -276,7 +269,6 @@ async def test_agent_pools_begin_complete_upgrade(self, resource_group): resource_group_name=resource_group.name, resource_name="str", agent_pool_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -292,7 +284,20 @@ async def test_agent_pools_begin_delete_machines(self, resource_group): resource_name="str", agent_pool_name="str", machines={"machineNames": ["str"]}, - api_version="2025-10-02-preview", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_agent_pools_begin_upgrade_node_image_version(self, resource_group): + response = await ( + await self.client.agent_pools.begin_upgrade_node_image_version( + resource_group_name=resource_group.name, + resource_name="str", + agent_pool_name="str", ) ).result() # call '.result()' to poll until service return final result @@ -305,7 +310,6 @@ async def test_agent_pools_get_available_agent_pool_versions(self, resource_grou response = await self.client.agent_pools.get_available_agent_pool_versions( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -313,15 +317,12 @@ async def test_agent_pools_get_available_agent_pool_versions(self, resource_grou @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_agent_pools_begin_upgrade_node_image_version(self, resource_group): - response = await ( - await self.client.agent_pools.begin_upgrade_node_image_version( - resource_group_name=resource_group.name, - resource_name="str", - agent_pool_name="str", - api_version="2025-10-02-preview", - ) - ).result() # call '.result()' to poll until service return final result + async def test_agent_pools_get_upgrade_profile(self, resource_group): + response = await self.client.agent_pools.get_upgrade_profile( + resource_group_name=resource_group.name, + resource_name="str", + agent_pool_name="str", + ) # please add some check logic here by yourself # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_service_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_service_operations.py index dac05371f8e3..3f92bd83cc82 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_service_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_service_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -23,7 +23,6 @@ def setup_method(self, method): def test_container_service_list_node_image_versions(self, resource_group): response = self.client.container_service.list_node_image_versions( location="str", - api_version="2025-10-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_service_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_service_operations_async.py index 8c1b559afbe0..69d36ecabe6d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_service_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_service_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -24,7 +24,6 @@ def setup_method(self, method): async def test_container_service_list_node_image_versions(self, resource_group): response = self.client.container_service.list_node_image_versions( location="str", - api_version="2025-10-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_services_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_services_operations.py deleted file mode 100644 index 85e03d2ff547..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_services_operations.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerservice import ContainerServiceClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerServiceContainerServicesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerServiceClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.container_services.list( - api_version="2017-07-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): - response = self.client.container_services.begin_create_or_update( - resource_group_name=resource_group.name, - container_service_name="str", - parameters={ - "location": "str", - "agentPoolProfiles": [ - { - "name": "str", - "vmSize": "str", - "count": 1, - "dnsPrefix": "str", - "fqdn": "str", - "osDiskSizeGB": 0, - "osType": "Linux", - "ports": [0], - "storageProfile": "str", - "vnetSubnetID": "str", - } - ], - "customProfile": {"orchestrator": "str"}, - "diagnosticsProfile": {"vmDiagnostics": {"enabled": bool, "storageUri": "str"}}, - "id": "str", - "linuxProfile": {"adminUsername": "str", "ssh": {"publicKeys": [{"keyData": "str"}]}}, - "masterProfile": { - "dnsPrefix": "str", - "vmSize": "str", - "count": 1, - "firstConsecutiveStaticIP": "10.240.255.5", - "fqdn": "str", - "osDiskSizeGB": 0, - "storageProfile": "str", - "vnetSubnetID": "str", - }, - "name": "str", - "orchestratorProfile": {"orchestratorType": "str", "orchestratorVersion": "str"}, - "provisioningState": "str", - "servicePrincipalProfile": { - "clientId": "str", - "keyVaultSecretRef": {"secretName": "str", "vaultID": "str", "version": "str"}, - "secret": "str", - }, - "tags": {"str": "str"}, - "type": "str", - "windowsProfile": {"adminPassword": "str", "adminUsername": "str"}, - }, - api_version="2017-07-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.container_services.get( - resource_group_name=resource_group.name, - container_service_name="str", - api_version="2017-07-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete(self, resource_group): - response = self.client.container_services.begin_delete( - resource_group_name=resource_group.name, - container_service_name="str", - api_version="2017-07-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): - response = self.client.container_services.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2017-07-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_services_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_services_operations_async.py deleted file mode 100644 index c2f43791b5ec..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_container_services_operations_async.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerServiceContainerServicesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.container_services.list( - api_version="2017-07-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): - response = await ( - await self.client.container_services.begin_create_or_update( - resource_group_name=resource_group.name, - container_service_name="str", - parameters={ - "location": "str", - "agentPoolProfiles": [ - { - "name": "str", - "vmSize": "str", - "count": 1, - "dnsPrefix": "str", - "fqdn": "str", - "osDiskSizeGB": 0, - "osType": "Linux", - "ports": [0], - "storageProfile": "str", - "vnetSubnetID": "str", - } - ], - "customProfile": {"orchestrator": "str"}, - "diagnosticsProfile": {"vmDiagnostics": {"enabled": bool, "storageUri": "str"}}, - "id": "str", - "linuxProfile": {"adminUsername": "str", "ssh": {"publicKeys": [{"keyData": "str"}]}}, - "masterProfile": { - "dnsPrefix": "str", - "vmSize": "str", - "count": 1, - "firstConsecutiveStaticIP": "10.240.255.5", - "fqdn": "str", - "osDiskSizeGB": 0, - "storageProfile": "str", - "vnetSubnetID": "str", - }, - "name": "str", - "orchestratorProfile": {"orchestratorType": "str", "orchestratorVersion": "str"}, - "provisioningState": "str", - "servicePrincipalProfile": { - "clientId": "str", - "keyVaultSecretRef": {"secretName": "str", "vaultID": "str", "version": "str"}, - "secret": "str", - }, - "tags": {"str": "str"}, - "type": "str", - "windowsProfile": {"adminPassword": "str", "adminUsername": "str"}, - }, - api_version="2017-07-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get(self, resource_group): - response = await self.client.container_services.get( - resource_group_name=resource_group.name, - container_service_name="str", - api_version="2017-07-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): - response = await ( - await self.client.container_services.begin_delete( - resource_group_name=resource_group.name, - container_service_name="str", - api_version="2017-07-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): - response = self.client.container_services.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2017-07-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleet_members_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleet_members_operations.py deleted file mode 100644 index 8f6a63a69b61..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleet_members_operations.py +++ /dev/null @@ -1,86 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerservice import ContainerServiceClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerServiceFleetMembersOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerServiceClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): - response = self.client.fleet_members.begin_create_or_update( - resource_group_name=resource_group.name, - fleet_name="str", - fleet_member_name="str", - parameters={ - "clusterResourceId": "str", - "etag": "str", - "id": "str", - "name": "str", - "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2022-06-02-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.fleet_members.get( - resource_group_name=resource_group.name, - fleet_name="str", - fleet_member_name="str", - api_version="2022-06-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete(self, resource_group): - response = self.client.fleet_members.begin_delete( - resource_group_name=resource_group.name, - fleet_name="str", - fleet_member_name="str", - api_version="2022-06-02-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_fleet(self, resource_group): - response = self.client.fleet_members.list_by_fleet( - resource_group_name=resource_group.name, - fleet_name="str", - api_version="2022-06-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleet_members_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleet_members_operations_async.py deleted file mode 100644 index c288b5a9d096..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleet_members_operations_async.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerServiceFleetMembersOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): - response = await ( - await self.client.fleet_members.begin_create_or_update( - resource_group_name=resource_group.name, - fleet_name="str", - fleet_member_name="str", - parameters={ - "clusterResourceId": "str", - "etag": "str", - "id": "str", - "name": "str", - "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "type": "str", - }, - api_version="2022-06-02-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get(self, resource_group): - response = await self.client.fleet_members.get( - resource_group_name=resource_group.name, - fleet_name="str", - fleet_member_name="str", - api_version="2022-06-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): - response = await ( - await self.client.fleet_members.begin_delete( - resource_group_name=resource_group.name, - fleet_name="str", - fleet_member_name="str", - api_version="2022-06-02-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_by_fleet(self, resource_group): - response = self.client.fleet_members.list_by_fleet( - resource_group_name=resource_group.name, - fleet_name="str", - api_version="2022-06-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleets_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleets_operations.py deleted file mode 100644 index a9a875c2da87..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleets_operations.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerservice import ContainerServiceClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerServiceFleetsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerServiceClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): - response = self.client.fleets.begin_create_or_update( - resource_group_name=resource_group.name, - fleet_name="str", - parameters={ - "location": "str", - "etag": "str", - "hubProfile": {"dnsPrefix": "str", "fqdn": "str", "kubernetesVersion": "str"}, - "id": "str", - "name": "str", - "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2022-06-02-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_update(self, resource_group): - response = self.client.fleets.update( - resource_group_name=resource_group.name, - fleet_name="str", - api_version="2022-06-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.fleets.get( - resource_group_name=resource_group.name, - fleet_name="str", - api_version="2022-06-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete(self, resource_group): - response = self.client.fleets.begin_delete( - resource_group_name=resource_group.name, - fleet_name="str", - api_version="2022-06-02-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): - response = self.client.fleets.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2022-06-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.fleets.list( - api_version="2022-06-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_credentials(self, resource_group): - response = self.client.fleets.list_credentials( - resource_group_name=resource_group.name, - fleet_name="str", - api_version="2022-06-02-preview", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleets_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleets_operations_async.py deleted file mode 100644 index 3523bbe481af..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_fleets_operations_async.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerServiceFleetsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): - response = await ( - await self.client.fleets.begin_create_or_update( - resource_group_name=resource_group.name, - fleet_name="str", - parameters={ - "location": "str", - "etag": "str", - "hubProfile": {"dnsPrefix": "str", "fqdn": "str", "kubernetesVersion": "str"}, - "id": "str", - "name": "str", - "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2022-06-02-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_update(self, resource_group): - response = await self.client.fleets.update( - resource_group_name=resource_group.name, - fleet_name="str", - api_version="2022-06-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get(self, resource_group): - response = await self.client.fleets.get( - resource_group_name=resource_group.name, - fleet_name="str", - api_version="2022-06-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): - response = await ( - await self.client.fleets.begin_delete( - resource_group_name=resource_group.name, - fleet_name="str", - api_version="2022-06-02-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): - response = self.client.fleets.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2022-06-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.fleets.list( - api_version="2022-06-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_credentials(self, resource_group): - response = await self.client.fleets.list_credentials( - resource_group_name=resource_group.name, - fleet_name="str", - api_version="2022-06-02-preview", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_identity_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_identity_bindings_operations.py index cd9f2fa84431..2464229a3578 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_identity_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_identity_bindings_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestContainerServiceIdentityBindingsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_identity_bindings_list_by_managed_cluster(self, resource_group): - response = self.client.identity_bindings.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_identity_bindings_get(self, resource_group): @@ -37,7 +25,6 @@ def test_identity_bindings_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", identity_binding_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -69,7 +56,6 @@ def test_identity_bindings_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -82,8 +68,18 @@ def test_identity_bindings_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", identity_binding_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_identity_bindings_list_by_managed_cluster(self, resource_group): + response = self.client.identity_bindings.list_by_managed_cluster( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_identity_bindings_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_identity_bindings_operations_async.py index dbfe650f2277..79a1b1bf1a08 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_identity_bindings_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_identity_bindings_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestContainerServiceIdentityBindingsOperationsAsync(AzureMgmtRecordedTestC def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_identity_bindings_list_by_managed_cluster(self, resource_group): - response = self.client.identity_bindings.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_identity_bindings_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_identity_bindings_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", identity_binding_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -76,7 +63,6 @@ async def test_identity_bindings_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -91,9 +77,19 @@ async def test_identity_bindings_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", identity_binding_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_identity_bindings_list_by_managed_cluster(self, resource_group): + response = self.client.identity_bindings.list_by_managed_cluster( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_jwt_authenticators_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_jwt_authenticators_operations.py index 3cc63bdaca03..213f7d4ce6e2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_jwt_authenticators_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_jwt_authenticators_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestContainerServiceJWTAuthenticatorsOperations(AzureMgmtRecordedTestCase) def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_jwt_authenticators_list_by_managed_cluster(self, resource_group): - response = self.client.jwt_authenticators.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_jwt_authenticators_get(self, resource_group): @@ -37,7 +25,6 @@ def test_jwt_authenticators_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", jwt_authenticator_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -75,7 +62,6 @@ def test_jwt_authenticators_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -88,8 +74,18 @@ def test_jwt_authenticators_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", jwt_authenticator_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_jwt_authenticators_list_by_managed_cluster(self, resource_group): + response = self.client.jwt_authenticators.list_by_managed_cluster( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_jwt_authenticators_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_jwt_authenticators_operations_async.py index dd4f229e7416..443ce317cca2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_jwt_authenticators_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_jwt_authenticators_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestContainerServiceJWTAuthenticatorsOperationsAsync(AzureMgmtRecordedTest def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_jwt_authenticators_list_by_managed_cluster(self, resource_group): - response = self.client.jwt_authenticators.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_jwt_authenticators_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_jwt_authenticators_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", jwt_authenticator_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -77,7 +64,6 @@ async def test_jwt_authenticators_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -92,9 +78,19 @@ async def test_jwt_authenticators_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", jwt_authenticator_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_jwt_authenticators_list_by_managed_cluster(self, resource_group): + response = self.client.jwt_authenticators.list_by_managed_cluster( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_load_balancers_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_load_balancers_operations.py index 7ed9bca2092c..6beca80132b4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_load_balancers_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_load_balancers_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestContainerServiceLoadBalancersOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_load_balancers_list_by_managed_cluster(self, resource_group): - response = self.client.load_balancers.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_load_balancers_get(self, resource_group): @@ -37,7 +25,6 @@ def test_load_balancers_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", load_balancer_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -51,22 +38,24 @@ def test_load_balancers_create_or_update(self, resource_group): resource_name="str", load_balancer_name="str", parameters={ - "allowServicePlacement": bool, "id": "str", "name": "str", - "nodeSelector": { - "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], - "matchLabels": ["str"], - }, - "primaryAgentPoolName": "str", - "provisioningState": "str", - "serviceLabelSelector": { - "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], - "matchLabels": ["str"], - }, - "serviceNamespaceSelector": { - "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], - "matchLabels": ["str"], + "properties": { + "primaryAgentPoolName": "str", + "allowServicePlacement": bool, + "nodeSelector": { + "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], + "matchLabels": ["str"], + }, + "provisioningState": "str", + "serviceLabelSelector": { + "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], + "matchLabels": ["str"], + }, + "serviceNamespaceSelector": { + "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], + "matchLabels": ["str"], + }, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -78,7 +67,6 @@ def test_load_balancers_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -91,8 +79,18 @@ def test_load_balancers_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", load_balancer_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_load_balancers_list_by_managed_cluster(self, resource_group): + response = self.client.load_balancers.list_by_managed_cluster( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_load_balancers_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_load_balancers_operations_async.py index da601c2f043b..83971f7d7920 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_load_balancers_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_load_balancers_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestContainerServiceLoadBalancersOperationsAsync(AzureMgmtRecordedTestCase def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_load_balancers_list_by_managed_cluster(self, resource_group): - response = self.client.load_balancers.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_load_balancers_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_load_balancers_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", load_balancer_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -52,22 +39,24 @@ async def test_load_balancers_create_or_update(self, resource_group): resource_name="str", load_balancer_name="str", parameters={ - "allowServicePlacement": bool, "id": "str", "name": "str", - "nodeSelector": { - "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], - "matchLabels": ["str"], - }, - "primaryAgentPoolName": "str", - "provisioningState": "str", - "serviceLabelSelector": { - "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], - "matchLabels": ["str"], - }, - "serviceNamespaceSelector": { - "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], - "matchLabels": ["str"], + "properties": { + "primaryAgentPoolName": "str", + "allowServicePlacement": bool, + "nodeSelector": { + "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], + "matchLabels": ["str"], + }, + "provisioningState": "str", + "serviceLabelSelector": { + "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], + "matchLabels": ["str"], + }, + "serviceNamespaceSelector": { + "matchExpressions": [{"key": "str", "operator": "str", "values": ["str"]}], + "matchLabels": ["str"], + }, }, "systemData": { "createdAt": "2020-02-20 00:00:00", @@ -79,7 +68,6 @@ async def test_load_balancers_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -93,9 +81,19 @@ async def test_load_balancers_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", load_balancer_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_load_balancers_list_by_managed_cluster(self, resource_group): + response = self.client.load_balancers.list_by_managed_cluster( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations.py index d694512bbade..5a4801235f2a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,19 +18,6 @@ class TestContainerServiceMachinesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_machines_list(self, resource_group): - response = self.client.machines.list( - resource_group_name=resource_group.name, - resource_name="str", - agent_pool_name="str", - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_machines_get(self, resource_group): @@ -39,7 +26,6 @@ def test_machines_get(self, resource_group): resource_name="str", agent_pool_name="str", machine_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -142,10 +128,10 @@ def test_machines_begin_create_or_update(self, resource_group): "osDiskSizeGB": 0, "osDiskType": "str", "osSKU": "str", - "osType": "Linux", + "osType": "str", "windowsProfile": {"disableOutboundNat": bool}, }, - "priority": "Regular", + "priority": "str", "provisioningState": "str", "resourceId": "str", "security": { @@ -169,11 +155,30 @@ def test_machines_begin_create_or_update(self, resource_group): }, "tags": {"str": "str"}, }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", "zones": ["str"], }, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_machines_list(self, resource_group): + response = self.client.machines.list( + resource_group_name=resource_group.name, + resource_name="str", + agent_pool_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations_async.py index d37a6976be2f..ca82ac63275b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_machines_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,19 +19,6 @@ class TestContainerServiceMachinesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_machines_list(self, resource_group): - response = self.client.machines.list( - resource_group_name=resource_group.name, - resource_name="str", - agent_pool_name="str", - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_machines_get(self, resource_group): @@ -40,7 +27,6 @@ async def test_machines_get(self, resource_group): resource_name="str", agent_pool_name="str", machine_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -144,10 +130,10 @@ async def test_machines_begin_create_or_update(self, resource_group): "osDiskSizeGB": 0, "osDiskType": "str", "osSKU": "str", - "osType": "Linux", + "osType": "str", "windowsProfile": {"disableOutboundNat": bool}, }, - "priority": "Regular", + "priority": "str", "provisioningState": "str", "resourceId": "str", "security": { @@ -171,12 +157,31 @@ async def test_machines_begin_create_or_update(self, resource_group): }, "tags": {"str": "str"}, }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", "zones": ["str"], }, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_machines_list(self, resource_group): + response = self.client.machines.list( + resource_group_name=resource_group.name, + resource_name="str", + agent_pool_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations.py index 047f995d2ca9..4b2d57b50abc 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestContainerServiceMaintenanceConfigurationsOperations(AzureMgmtRecordedT def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_maintenance_configurations_list_by_managed_cluster(self, resource_group): - response = self.client.maintenance_configurations.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_maintenance_configurations_get(self, resource_group): @@ -37,7 +25,6 @@ def test_maintenance_configurations_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", config_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -52,21 +39,24 @@ def test_maintenance_configurations_create_or_update(self, resource_group): config_name="str", parameters={ "id": "str", - "maintenanceWindow": { - "durationHours": 24, - "schedule": { - "absoluteMonthly": {"dayOfMonth": 0, "intervalMonths": 0}, - "daily": {"intervalDays": 0}, - "relativeMonthly": {"dayOfWeek": "str", "intervalMonths": 0, "weekIndex": "str"}, - "weekly": {"dayOfWeek": "str", "intervalWeeks": 0}, + "name": "str", + "properties": { + "maintenanceWindow": { + "durationHours": 0, + "schedule": { + "absoluteMonthly": {"dayOfMonth": 0, "intervalMonths": 0}, + "daily": {"intervalDays": 0}, + "relativeMonthly": {"dayOfWeek": "str", "intervalMonths": 0, "weekIndex": "str"}, + "weekly": {"dayOfWeek": "str", "intervalWeeks": 0}, + }, + "startTime": "str", + "notAllowedDates": [{"end": "2020-02-20", "start": "2020-02-20"}], + "startDate": "2020-02-20", + "utcOffset": "str", }, - "startTime": "str", - "notAllowedDates": [{"end": "2020-02-20", "start": "2020-02-20"}], - "startDate": "2020-02-20", - "utcOffset": "str", + "notAllowedTime": [{"end": "2020-02-20 00:00:00", "start": "2020-02-20 00:00:00"}], + "timeInWeek": [{"day": "str", "hourSlots": [0]}], }, - "name": "str", - "notAllowedTime": [{"end": "2020-02-20 00:00:00", "start": "2020-02-20 00:00:00"}], "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -75,10 +65,8 @@ def test_maintenance_configurations_create_or_update(self, resource_group): "lastModifiedBy": "str", "lastModifiedByType": "str", }, - "timeInWeek": [{"day": "str", "hourSlots": [0]}], "type": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -91,8 +79,18 @@ def test_maintenance_configurations_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", config_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_maintenance_configurations_list_by_managed_cluster(self, resource_group): + response = self.client.maintenance_configurations.list_by_managed_cluster( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations_async.py index de61f8605e5c..5f24e461d65e 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_maintenance_configurations_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestContainerServiceMaintenanceConfigurationsOperationsAsync(AzureMgmtReco def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_maintenance_configurations_list_by_managed_cluster(self, resource_group): - response = self.client.maintenance_configurations.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_maintenance_configurations_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_maintenance_configurations_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", config_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -53,21 +40,24 @@ async def test_maintenance_configurations_create_or_update(self, resource_group) config_name="str", parameters={ "id": "str", - "maintenanceWindow": { - "durationHours": 24, - "schedule": { - "absoluteMonthly": {"dayOfMonth": 0, "intervalMonths": 0}, - "daily": {"intervalDays": 0}, - "relativeMonthly": {"dayOfWeek": "str", "intervalMonths": 0, "weekIndex": "str"}, - "weekly": {"dayOfWeek": "str", "intervalWeeks": 0}, + "name": "str", + "properties": { + "maintenanceWindow": { + "durationHours": 0, + "schedule": { + "absoluteMonthly": {"dayOfMonth": 0, "intervalMonths": 0}, + "daily": {"intervalDays": 0}, + "relativeMonthly": {"dayOfWeek": "str", "intervalMonths": 0, "weekIndex": "str"}, + "weekly": {"dayOfWeek": "str", "intervalWeeks": 0}, + }, + "startTime": "str", + "notAllowedDates": [{"end": "2020-02-20", "start": "2020-02-20"}], + "startDate": "2020-02-20", + "utcOffset": "str", }, - "startTime": "str", - "notAllowedDates": [{"end": "2020-02-20", "start": "2020-02-20"}], - "startDate": "2020-02-20", - "utcOffset": "str", + "notAllowedTime": [{"end": "2020-02-20 00:00:00", "start": "2020-02-20 00:00:00"}], + "timeInWeek": [{"day": "str", "hourSlots": [0]}], }, - "name": "str", - "notAllowedTime": [{"end": "2020-02-20 00:00:00", "start": "2020-02-20 00:00:00"}], "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -76,10 +66,8 @@ async def test_maintenance_configurations_create_or_update(self, resource_group) "lastModifiedBy": "str", "lastModifiedByType": "str", }, - "timeInWeek": [{"day": "str", "hourSlots": [0]}], "type": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -92,8 +80,18 @@ async def test_maintenance_configurations_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", config_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_maintenance_configurations_list_by_managed_cluster(self, resource_group): + response = self.client.maintenance_configurations.list_by_managed_cluster( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_cluster_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_cluster_snapshots_operations.py index b0229d30327f..d02b777d78c1 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_cluster_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_cluster_snapshots_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,34 +18,12 @@ class TestContainerServiceManagedClusterSnapshotsOperations(AzureMgmtRecordedTes def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_cluster_snapshots_list(self, resource_group): - response = self.client.managed_cluster_snapshots.list( - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_cluster_snapshots_list_by_resource_group(self, resource_group): - response = self.client.managed_cluster_snapshots.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_cluster_snapshots_get(self, resource_group): response = self.client.managed_cluster_snapshots.get( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -59,22 +37,24 @@ def test_managed_cluster_snapshots_create_or_update(self, resource_group): resource_name="str", parameters={ "location": "str", - "creationData": {"sourceResourceId": "str"}, "id": "str", - "managedClusterPropertiesReadOnly": { - "enableRbac": bool, - "kubernetesVersion": "str", - "networkProfile": { - "loadBalancerSku": "str", - "networkMode": "str", - "networkPlugin": "str", - "networkPluginMode": "str", - "networkPolicy": "str", + "name": "str", + "properties": { + "creationData": {"sourceResourceId": "str"}, + "managedClusterPropertiesReadOnly": { + "enableRbac": bool, + "kubernetesVersion": "str", + "networkProfile": { + "loadBalancerSku": "str", + "networkMode": "str", + "networkPlugin": "str", + "networkPluginMode": "str", + "networkPolicy": "str", + }, + "sku": {"name": "str", "tier": "str"}, }, - "sku": {"name": "str", "tier": "str"}, + "snapshotType": "str", }, - "name": "str", - "snapshotType": "NodePool", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -86,7 +66,6 @@ def test_managed_cluster_snapshots_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -99,7 +78,6 @@ def test_managed_cluster_snapshots_update_tags(self, resource_group): resource_group_name=resource_group.name, resource_name="str", parameters={"tags": {"str": "str"}}, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -111,8 +89,25 @@ def test_managed_cluster_snapshots_delete(self, resource_group): response = self.client.managed_cluster_snapshots.delete( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_cluster_snapshots_list_by_resource_group(self, resource_group): + response = self.client.managed_cluster_snapshots.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_cluster_snapshots_list(self, resource_group): + response = self.client.managed_cluster_snapshots.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_cluster_snapshots_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_cluster_snapshots_operations_async.py index f08b3165b6d8..3c60017f23e4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_cluster_snapshots_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_cluster_snapshots_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,34 +19,12 @@ class TestContainerServiceManagedClusterSnapshotsOperationsAsync(AzureMgmtRecord def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_cluster_snapshots_list(self, resource_group): - response = self.client.managed_cluster_snapshots.list( - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_cluster_snapshots_list_by_resource_group(self, resource_group): - response = self.client.managed_cluster_snapshots.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_cluster_snapshots_get(self, resource_group): response = await self.client.managed_cluster_snapshots.get( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -60,22 +38,24 @@ async def test_managed_cluster_snapshots_create_or_update(self, resource_group): resource_name="str", parameters={ "location": "str", - "creationData": {"sourceResourceId": "str"}, "id": "str", - "managedClusterPropertiesReadOnly": { - "enableRbac": bool, - "kubernetesVersion": "str", - "networkProfile": { - "loadBalancerSku": "str", - "networkMode": "str", - "networkPlugin": "str", - "networkPluginMode": "str", - "networkPolicy": "str", + "name": "str", + "properties": { + "creationData": {"sourceResourceId": "str"}, + "managedClusterPropertiesReadOnly": { + "enableRbac": bool, + "kubernetesVersion": "str", + "networkProfile": { + "loadBalancerSku": "str", + "networkMode": "str", + "networkPlugin": "str", + "networkPluginMode": "str", + "networkPolicy": "str", + }, + "sku": {"name": "str", "tier": "str"}, }, - "sku": {"name": "str", "tier": "str"}, + "snapshotType": "str", }, - "name": "str", - "snapshotType": "NodePool", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -87,7 +67,6 @@ async def test_managed_cluster_snapshots_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -100,7 +79,6 @@ async def test_managed_cluster_snapshots_update_tags(self, resource_group): resource_group_name=resource_group.name, resource_name="str", parameters={"tags": {"str": "str"}}, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -112,8 +90,25 @@ async def test_managed_cluster_snapshots_delete(self, resource_group): response = await self.client.managed_cluster_snapshots.delete( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_cluster_snapshots_list_by_resource_group(self, resource_group): + response = self.client.managed_cluster_snapshots.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_cluster_snapshots_list(self, resource_group): + response = self.client.managed_cluster_snapshots.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations.py index 0b3a78b1c5a2..f4e5c5a02176 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,106 +18,12 @@ class TestContainerServiceManagedClustersOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_clusters_list_kubernetes_versions(self, resource_group): - response = self.client.managed_clusters.list_kubernetes_versions( - location="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_clusters_list(self, resource_group): - response = self.client.managed_clusters.list( - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_clusters_list_by_resource_group(self, resource_group): - response = self.client.managed_clusters.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_clusters_get_upgrade_profile(self, resource_group): - response = self.client.managed_clusters.get_upgrade_profile( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_clusters_get_access_profile(self, resource_group): - response = self.client.managed_clusters.get_access_profile( - resource_group_name=resource_group.name, - resource_name="str", - role_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_clusters_list_cluster_admin_credentials(self, resource_group): - response = self.client.managed_clusters.list_cluster_admin_credentials( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_clusters_list_cluster_user_credentials(self, resource_group): - response = self.client.managed_clusters.list_cluster_user_credentials( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_clusters_list_cluster_monitoring_user_credentials(self, resource_group): - response = self.client.managed_clusters.list_cluster_monitoring_user_credentials( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_clusters_get(self, resource_group): response = self.client.managed_clusters.get( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -131,262 +37,8 @@ def test_managed_clusters_begin_create_or_update(self, resource_group): resource_name="str", parameters={ "location": "str", - "aadProfile": { - "adminGroupObjectIDs": ["str"], - "clientAppID": "str", - "enableAzureRBAC": bool, - "managed": bool, - "serverAppID": "str", - "serverAppSecret": "str", - "tenantID": "str", - }, - "addonProfiles": { - "str": { - "enabled": bool, - "config": {"str": "str"}, - "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, - } - }, - "agentPoolProfiles": [ - { - "name": "str", - "artifactStreamingProfile": {"enabled": bool}, - "availabilityZones": ["str"], - "capacityReservationGroupID": "str", - "count": 0, - "creationData": {"sourceResourceId": "str"}, - "currentOrchestratorVersion": "str", - "eTag": "str", - "enableAutoScaling": bool, - "enableEncryptionAtHost": bool, - "enableFIPS": bool, - "enableNodePublicIP": bool, - "enableUltraSSD": bool, - "gatewayProfile": {"publicIPPrefixSize": 31}, - "gpuInstanceProfile": "str", - "gpuProfile": {"driver": "str", "driverType": "str"}, - "hostGroupID": "str", - "kubeletConfig": { - "allowedUnsafeSysctls": ["str"], - "containerLogMaxFiles": 0, - "containerLogMaxSizeMB": 0, - "cpuCfsQuota": bool, - "cpuCfsQuotaPeriod": "str", - "cpuManagerPolicy": "str", - "failSwapOn": bool, - "imageGcHighThreshold": 0, - "imageGcLowThreshold": 0, - "podMaxPids": 0, - "seccompDefault": "str", - "topologyManagerPolicy": "str", - }, - "kubeletDiskType": "str", - "linuxOSConfig": { - "swapFileSizeMB": 0, - "sysctls": { - "fsAioMaxNr": 0, - "fsFileMax": 0, - "fsInotifyMaxUserWatches": 0, - "fsNrOpen": 0, - "kernelThreadsMax": 0, - "netCoreNetdevMaxBacklog": 0, - "netCoreOptmemMax": 0, - "netCoreRmemDefault": 0, - "netCoreRmemMax": 0, - "netCoreSomaxconn": 0, - "netCoreWmemDefault": 0, - "netCoreWmemMax": 0, - "netIpv4IpLocalPortRange": "str", - "netIpv4NeighDefaultGcThresh1": 0, - "netIpv4NeighDefaultGcThresh2": 0, - "netIpv4NeighDefaultGcThresh3": 0, - "netIpv4TcpFinTimeout": 0, - "netIpv4TcpKeepaliveProbes": 0, - "netIpv4TcpKeepaliveTime": 0, - "netIpv4TcpMaxSynBacklog": 0, - "netIpv4TcpMaxTwBuckets": 0, - "netIpv4TcpTwReuse": bool, - "netIpv4TcpkeepaliveIntvl": 0, - "netNetfilterNfConntrackBuckets": 0, - "netNetfilterNfConntrackMax": 0, - "vmMaxMapCount": 0, - "vmSwappiness": 0, - "vmVfsCachePressure": 0, - }, - "transparentHugePageDefrag": "str", - "transparentHugePageEnabled": "str", - }, - "localDNSProfile": { - "kubeDNSOverrides": { - "str": { - "cacheDurationInSeconds": 3600, - "forwardDestination": "ClusterCoreDNS", - "forwardPolicy": "Sequential", - "maxConcurrent": 1000, - "protocol": "PreferUDP", - "queryLogging": "Error", - "serveStale": "Immediate", - "serveStaleDurationInSeconds": 3600, - } - }, - "mode": "Preferred", - "state": "str", - "vnetDNSOverrides": { - "str": { - "cacheDurationInSeconds": 3600, - "forwardDestination": "ClusterCoreDNS", - "forwardPolicy": "Sequential", - "maxConcurrent": 1000, - "protocol": "PreferUDP", - "queryLogging": "Error", - "serveStale": "Immediate", - "serveStaleDurationInSeconds": 3600, - } - }, - }, - "maxCount": 0, - "maxPods": 0, - "messageOfTheDay": "str", - "minCount": 0, - "mode": "str", - "networkProfile": { - "allowedHostPorts": [{"portEnd": 0, "portStart": 0, "protocol": "str"}], - "applicationSecurityGroups": ["str"], - "nodePublicIPTags": [{"ipTagType": "str", "tag": "str"}], - }, - "nodeCustomizationProfile": {"nodeCustomizationId": "str"}, - "nodeImageVersion": "str", - "nodeInitializationTaints": ["str"], - "nodeLabels": {"str": "str"}, - "nodePublicIPPrefixID": "str", - "nodeTaints": ["str"], - "orchestratorVersion": "str", - "osDiskSizeGB": 0, - "osDiskType": "str", - "osSKU": "str", - "osType": "Linux", - "podIPAllocationMode": "str", - "podSubnetID": "str", - "powerState": {"code": "str"}, - "provisioningState": "str", - "proximityPlacementGroupID": "str", - "scaleDownMode": "str", - "scaleSetEvictionPolicy": "Delete", - "scaleSetPriority": "Regular", - "securityProfile": {"enableSecureBoot": bool, "enableVTPM": bool, "sshAccess": "str"}, - "spotMaxPrice": -1, - "status": { - "provisioningError": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - } - }, - "tags": {"str": "str"}, - "type": "str", - "upgradeSettings": { - "drainTimeoutInMinutes": 0, - "maxBlockedNodes": "str", - "maxSurge": "str", - "maxUnavailable": "str", - "nodeSoakDurationInMinutes": 0, - "undrainableNodeBehavior": "str", - }, - "upgradeSettingsBlueGreen": { - "batchSoakDurationInMinutes": 0, - "drainBatchSize": "str", - "drainTimeoutInMinutes": 0, - "finalSoakDurationInMinutes": 0, - }, - "upgradeStrategy": "str", - "virtualMachineNodesStatus": [{"count": 0, "size": "str"}], - "virtualMachinesProfile": { - "scale": { - "autoscale": {"maxCount": 0, "minCount": 0, "size": "str"}, - "manual": [{"count": 0, "size": "str"}], - } - }, - "vmSize": "str", - "vnetSubnetID": "str", - "windowsProfile": {"disableOutboundNat": bool}, - "workloadRuntime": "str", - } - ], - "aiToolchainOperatorProfile": {"enabled": bool}, - "apiServerAccessProfile": { - "authorizedIPRanges": ["str"], - "disableRunCommand": bool, - "enablePrivateCluster": bool, - "enablePrivateClusterPublicFQDN": bool, - "enableVnetIntegration": bool, - "privateDNSZone": "str", - "subnetId": "str", - }, - "autoScalerProfile": { - "balance-similar-node-groups": "str", - "daemonset-eviction-for-empty-nodes": bool, - "daemonset-eviction-for-occupied-nodes": bool, - "expander": "str", - "ignore-daemonsets-utilization": bool, - "max-empty-bulk-delete": "str", - "max-graceful-termination-sec": "str", - "max-node-provision-time": "str", - "max-total-unready-percentage": "str", - "new-pod-scale-up-delay": "str", - "ok-total-unready-count": "str", - "scale-down-delay-after-add": "str", - "scale-down-delay-after-delete": "str", - "scale-down-delay-after-failure": "str", - "scale-down-unneeded-time": "str", - "scale-down-unready-time": "str", - "scale-down-utilization-threshold": "str", - "scan-interval": "str", - "skip-nodes-with-local-storage": "str", - "skip-nodes-with-system-pods": "str", - }, - "autoUpgradeProfile": {"nodeOSUpgradeChannel": "str", "upgradeChannel": "str"}, - "azureMonitorProfile": { - "appMonitoring": { - "autoInstrumentation": {"enabled": bool}, - "openTelemetryLogs": {"enabled": bool, "port": 0}, - "openTelemetryMetrics": {"enabled": bool, "port": 0}, - }, - "containerInsights": { - "disableCustomMetrics": bool, - "disablePrometheusMetricsScraping": bool, - "enabled": bool, - "logAnalyticsWorkspaceResourceId": "str", - "syslogPort": 0, - }, - "metrics": { - "enabled": bool, - "kubeStateMetrics": {"metricAnnotationsAllowList": "str", "metricLabelsAllowlist": "str"}, - }, - }, - "azurePortalFQDN": "str", - "bootstrapProfile": {"artifactSource": "Direct", "containerRegistryId": "str"}, - "creationData": {"sourceResourceId": "str"}, - "currentKubernetesVersion": "str", - "disableLocalAccounts": bool, - "diskEncryptionSetID": "str", - "dnsPrefix": "str", "eTag": "str", - "enableNamespaceResources": bool, - "enableRBAC": bool, "extendedLocation": {"name": "str", "type": "str"}, - "fqdn": "str", - "fqdnSubdomain": "str", - "hostedSystemProfile": {"enabled": bool}, - "httpProxyConfig": { - "effectiveNoProxy": ["str"], - "enabled": bool, - "httpProxy": "str", - "httpsProxy": "str", - "noProxy": ["str"], - "trustedCa": "str", - }, "id": "str", "identity": { "delegatedResources": { @@ -397,187 +49,462 @@ def test_managed_clusters_begin_create_or_update(self, resource_group): "type": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - "identityProfile": {"str": {"clientId": "str", "objectId": "str", "resourceId": "str"}}, - "ingressProfile": { - "applicationLoadBalancer": { - "enabled": bool, - "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, - }, - "gatewayAPI": {"installation": "str"}, - "webAppRouting": { - "defaultDomain": {"domainName": "str", "enabled": bool}, - "dnsZoneResourceIds": ["str"], - "enabled": bool, - "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, - "nginx": {"defaultIngressControllerType": "str"}, - }, - }, "kind": "str", - "kubernetesVersion": "str", - "linuxProfile": {"adminUsername": "str", "ssh": {"publicKeys": [{"keyData": "str"}]}}, - "maxAgentPools": 0, - "metricsProfile": {"costAnalysis": {"enabled": bool}}, "name": "str", - "networkProfile": { - "advancedNetworking": { - "enabled": bool, - "observability": {"enabled": bool}, - "performance": {"accelerationMode": "None"}, - "security": { - "advancedNetworkPolicies": "str", - "enabled": bool, - "transitEncryption": {"type": "str"}, - }, - }, - "dnsServiceIP": "10.0.0.10", - "ipFamilies": ["str"], - "kubeProxyConfig": { - "enabled": bool, - "ipvsConfig": { - "scheduler": "str", - "tcpFinTimeoutSeconds": 0, - "tcpTimeoutSeconds": 0, - "udpTimeoutSeconds": 0, - }, - "mode": "str", - }, - "loadBalancerProfile": { - "allocatedOutboundPorts": 0, - "backendPoolType": "NodeIPConfiguration", - "clusterServiceLoadBalancerHealthProbeMode": "ServiceNodePort", - "effectiveOutboundIPs": [{"id": "str"}], - "enableMultipleStandardLoadBalancers": bool, - "idleTimeoutInMinutes": 30, - "managedOutboundIPs": {"count": 1, "countIPv6": 0}, - "outboundIPPrefixes": {"publicIPPrefixes": [{"id": "str"}]}, - "outboundIPs": {"publicIPs": [{"id": "str"}]}, + "properties": { + "aadProfile": { + "adminGroupObjectIDs": ["str"], + "clientAppID": "str", + "enableAzureRBAC": bool, + "managed": bool, + "serverAppID": "str", + "serverAppSecret": "str", + "tenantID": "str", }, - "loadBalancerSku": "str", - "natGatewayProfile": { - "effectiveOutboundIPs": [{"id": "str"}], - "idleTimeoutInMinutes": 4, - "managedOutboundIPProfile": {"count": 1}, + "addonProfiles": { + "str": { + "enabled": bool, + "config": {"str": "str"}, + "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, + } }, - "networkDataplane": "str", - "networkMode": "str", - "networkPlugin": "str", - "networkPluginMode": "str", - "networkPolicy": "str", - "outboundType": "loadBalancer", - "podCidr": "10.244.0.0/16", - "podCidrs": ["str"], - "podLinkLocalAccess": "str", - "serviceCidr": "10.0.0.0/16", - "serviceCidrs": ["str"], - "staticEgressGatewayProfile": {"enabled": bool}, - }, - "nodeProvisioningProfile": {"defaultNodePools": "Auto", "mode": "str"}, - "nodeResourceGroup": "str", - "nodeResourceGroupProfile": {"restrictionLevel": "str"}, - "oidcIssuerProfile": {"enabled": bool, "issuerURL": "str"}, - "podIdentityProfile": { - "allowNetworkPluginKubenet": bool, - "enabled": bool, - "userAssignedIdentities": [ + "agentPoolProfiles": [ { - "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, "name": "str", - "namespace": "str", - "bindingSelector": "str", - "provisioningInfo": { - "error": {"error": {"code": "str", "details": [...], "message": "str", "target": "str"}} + "artifactStreamingProfile": {"enabled": bool}, + "availabilityZones": ["str"], + "capacityReservationGroupID": "str", + "count": 0, + "creationData": {"sourceResourceId": "str"}, + "currentOrchestratorVersion": "str", + "eTag": "str", + "enableAutoScaling": bool, + "enableEncryptionAtHost": bool, + "enableFIPS": bool, + "enableNodePublicIP": bool, + "enableUltraSSD": bool, + "gatewayProfile": {"publicIPPrefixSize": 0}, + "gpuInstanceProfile": "str", + "gpuProfile": {"driver": "str", "driverType": "str"}, + "hostGroupID": "str", + "kubeletConfig": { + "allowedUnsafeSysctls": ["str"], + "containerLogMaxFiles": 0, + "containerLogMaxSizeMB": 0, + "cpuCfsQuota": bool, + "cpuCfsQuotaPeriod": "str", + "cpuManagerPolicy": "str", + "failSwapOn": bool, + "imageGcHighThreshold": 0, + "imageGcLowThreshold": 0, + "podMaxPids": 0, + "seccompDefault": "str", + "topologyManagerPolicy": "str", + }, + "kubeletDiskType": "str", + "linuxOSConfig": { + "swapFileSizeMB": 0, + "sysctls": { + "fsAioMaxNr": 0, + "fsFileMax": 0, + "fsInotifyMaxUserWatches": 0, + "fsNrOpen": 0, + "kernelThreadsMax": 0, + "netCoreNetdevMaxBacklog": 0, + "netCoreOptmemMax": 0, + "netCoreRmemDefault": 0, + "netCoreRmemMax": 0, + "netCoreSomaxconn": 0, + "netCoreWmemDefault": 0, + "netCoreWmemMax": 0, + "netIpv4IpLocalPortRange": "str", + "netIpv4NeighDefaultGcThresh1": 0, + "netIpv4NeighDefaultGcThresh2": 0, + "netIpv4NeighDefaultGcThresh3": 0, + "netIpv4TcpFinTimeout": 0, + "netIpv4TcpKeepaliveProbes": 0, + "netIpv4TcpKeepaliveTime": 0, + "netIpv4TcpMaxSynBacklog": 0, + "netIpv4TcpMaxTwBuckets": 0, + "netIpv4TcpTwReuse": bool, + "netIpv4TcpkeepaliveIntvl": 0, + "netNetfilterNfConntrackBuckets": 0, + "netNetfilterNfConntrackMax": 0, + "vmMaxMapCount": 0, + "vmSwappiness": 0, + "vmVfsCachePressure": 0, + }, + "transparentHugePageDefrag": "str", + "transparentHugePageEnabled": "str", + }, + "localDNSProfile": { + "kubeDNSOverrides": { + "str": { + "cacheDurationInSeconds": 0, + "forwardDestination": "str", + "forwardPolicy": "str", + "maxConcurrent": 0, + "protocol": "str", + "queryLogging": "str", + "serveStale": "str", + "serveStaleDurationInSeconds": 0, + } + }, + "mode": "str", + "state": "str", + "vnetDNSOverrides": { + "str": { + "cacheDurationInSeconds": 0, + "forwardDestination": "str", + "forwardPolicy": "str", + "maxConcurrent": 0, + "protocol": "str", + "queryLogging": "str", + "serveStale": "str", + "serveStaleDurationInSeconds": 0, + } + }, + }, + "maxCount": 0, + "maxPods": 0, + "messageOfTheDay": "str", + "minCount": 0, + "mode": "str", + "networkProfile": { + "allowedHostPorts": [{"portEnd": 0, "portStart": 0, "protocol": "str"}], + "applicationSecurityGroups": ["str"], + "nodePublicIPTags": [{"ipTagType": "str", "tag": "str"}], }, + "nodeCustomizationProfile": {"nodeCustomizationId": "str"}, + "nodeImageVersion": "str", + "nodeInitializationTaints": ["str"], + "nodeLabels": {"str": "str"}, + "nodePublicIPPrefixID": "str", + "nodeTaints": ["str"], + "orchestratorVersion": "str", + "osDiskSizeGB": 0, + "osDiskType": "str", + "osSKU": "str", + "osType": "str", + "podIPAllocationMode": "str", + "podSubnetID": "str", + "powerState": {"code": "str"}, "provisioningState": "str", + "proximityPlacementGroupID": "str", + "scaleDownMode": "str", + "scaleSetEvictionPolicy": "str", + "scaleSetPriority": "str", + "securityProfile": {"enableSecureBoot": bool, "enableVTPM": bool, "sshAccess": "str"}, + "spotMaxPrice": 0.0, + "status": { + "provisioningError": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + } + }, + "tags": {"str": "str"}, + "type": "str", + "upgradeSettings": { + "drainTimeoutInMinutes": 0, + "maxBlockedNodes": "str", + "maxSurge": "str", + "maxUnavailable": "str", + "nodeSoakDurationInMinutes": 0, + "undrainableNodeBehavior": "str", + }, + "upgradeSettingsBlueGreen": { + "batchSoakDurationInMinutes": 0, + "drainBatchSize": "str", + "drainTimeoutInMinutes": 0, + "finalSoakDurationInMinutes": 0, + }, + "upgradeStrategy": "str", + "virtualMachineNodesStatus": [{"count": 0, "size": "str"}], + "virtualMachinesProfile": { + "scale": { + "autoscale": {"maxCount": 0, "minCount": 0, "size": "str"}, + "manual": [{"count": 0, "size": "str"}], + } + }, + "vmSize": "str", + "vnetSubnetID": "str", + "windowsProfile": {"disableOutboundNat": bool}, + "workloadRuntime": "str", } ], - "userAssignedIdentityExceptions": [ - {"name": "str", "namespace": "str", "podLabels": {"str": "str"}} - ], - }, - "powerState": {"code": "str"}, - "privateFQDN": "str", - "privateLinkResources": [ - { - "groupId": "str", - "id": "str", - "name": "str", - "privateLinkServiceID": "str", - "requiredMembers": ["str"], - "type": "str", - } - ], - "provisioningState": "str", - "publicNetworkAccess": "str", - "resourceUID": "str", - "schedulerProfile": {"schedulerInstanceProfiles": {"upstream": {"schedulerConfigMode": "str"}}}, - "securityProfile": { - "azureKeyVaultKms": { + "aiToolchainOperatorProfile": {"enabled": bool}, + "apiServerAccessProfile": { + "authorizedIPRanges": ["str"], + "disableRunCommand": bool, + "enablePrivateCluster": bool, + "enablePrivateClusterPublicFQDN": bool, + "enableVnetIntegration": bool, + "privateDNSZone": "str", + "subnetId": "str", + }, + "autoScalerProfile": { + "balance-similar-node-groups": "str", + "daemonset-eviction-for-empty-nodes": bool, + "daemonset-eviction-for-occupied-nodes": bool, + "expander": "str", + "ignore-daemonsets-utilization": bool, + "max-empty-bulk-delete": "str", + "max-graceful-termination-sec": "str", + "max-node-provision-time": "str", + "max-total-unready-percentage": "str", + "new-pod-scale-up-delay": "str", + "ok-total-unready-count": "str", + "scale-down-delay-after-add": "str", + "scale-down-delay-after-delete": "str", + "scale-down-delay-after-failure": "str", + "scale-down-unneeded-time": "str", + "scale-down-unready-time": "str", + "scale-down-utilization-threshold": "str", + "scan-interval": "str", + "skip-nodes-with-local-storage": "str", + "skip-nodes-with-system-pods": "str", + }, + "autoUpgradeProfile": {"nodeOSUpgradeChannel": "str", "upgradeChannel": "str"}, + "azureMonitorProfile": { + "appMonitoring": { + "autoInstrumentation": {"enabled": bool}, + "openTelemetryLogs": {"enabled": bool, "port": 0}, + "openTelemetryMetrics": {"enabled": bool, "port": 0}, + }, + "containerInsights": { + "disableCustomMetrics": bool, + "disablePrometheusMetricsScraping": bool, + "enabled": bool, + "logAnalyticsWorkspaceResourceId": "str", + "syslogPort": 0, + }, + "metrics": { + "enabled": bool, + "kubeStateMetrics": {"metricAnnotationsAllowList": "str", "metricLabelsAllowlist": "str"}, + }, + }, + "azurePortalFQDN": "str", + "bootstrapProfile": {"artifactSource": "str", "containerRegistryId": "str"}, + "creationData": {"sourceResourceId": "str"}, + "currentKubernetesVersion": "str", + "disableLocalAccounts": bool, + "diskEncryptionSetID": "str", + "dnsPrefix": "str", + "enableNamespaceResources": bool, + "enableRBAC": bool, + "fqdn": "str", + "fqdnSubdomain": "str", + "hostedSystemProfile": {"enabled": bool}, + "httpProxyConfig": { + "effectiveNoProxy": ["str"], "enabled": bool, - "keyId": "str", - "keyVaultNetworkAccess": "Public", - "keyVaultResourceId": "str", + "httpProxy": "str", + "httpsProxy": "str", + "noProxy": ["str"], + "trustedCa": "str", }, - "customCATrustCertificates": [bytes("bytes", encoding="utf-8")], - "defender": { - "logAnalyticsWorkspaceResourceId": "str", - "securityGating": { - "allowSecretAccess": bool, + "identityProfile": {"str": {"clientId": "str", "objectId": "str", "resourceId": "str"}}, + "ingressProfile": { + "applicationLoadBalancer": { "enabled": bool, - "identities": [ - { - "azureContainerRegistry": "str", - "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, - } - ], + "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, + }, + "gatewayAPI": {"installation": "str"}, + "webAppRouting": { + "defaultDomain": {"domainName": "str", "enabled": bool}, + "dnsZoneResourceIds": ["str"], + "enabled": bool, + "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, + "nginx": {"defaultIngressControllerType": "str"}, }, - "securityMonitoring": {"enabled": bool}, }, - "imageCleaner": {"enabled": bool, "intervalHours": 0}, - "imageIntegrity": {"enabled": bool}, - "kubernetesResourceObjectEncryptionProfile": {"infrastructureEncryption": "Disabled"}, - "nodeRestriction": {"enabled": bool}, - "workloadIdentity": {"enabled": bool}, - }, - "serviceMeshProfile": { - "mode": "str", - "istio": { - "certificateAuthority": { - "plugin": { - "certChainObjectName": "str", - "certObjectName": "str", - "keyObjectName": "str", - "keyVaultId": "str", - "rootCertObjectName": "str", + "kubernetesVersion": "str", + "linuxProfile": {"adminUsername": "str", "ssh": {"publicKeys": [{"keyData": "str"}]}}, + "maxAgentPools": 0, + "metricsProfile": {"costAnalysis": {"enabled": bool}}, + "networkProfile": { + "advancedNetworking": { + "enabled": bool, + "observability": {"enabled": bool}, + "performance": {"accelerationMode": "str"}, + "security": { + "advancedNetworkPolicies": "str", + "enabled": bool, + "transitEncryption": {"type": "str"}, + }, + }, + "dnsServiceIP": "str", + "ipFamilies": ["str"], + "kubeProxyConfig": { + "enabled": bool, + "ipvsConfig": { + "scheduler": "str", + "tcpFinTimeoutSeconds": 0, + "tcpTimeoutSeconds": 0, + "udpTimeoutSeconds": 0, + }, + "mode": "str", + }, + "loadBalancerProfile": { + "allocatedOutboundPorts": 0, + "backendPoolType": "str", + "clusterServiceLoadBalancerHealthProbeMode": "str", + "effectiveOutboundIPs": [{"id": "str"}], + "enableMultipleStandardLoadBalancers": bool, + "idleTimeoutInMinutes": 0, + "managedOutboundIPs": {"count": 0, "countIPv6": 0}, + "outboundIPPrefixes": {"publicIPPrefixes": [{"id": "str"}]}, + "outboundIPs": {"publicIPs": [{"id": "str"}]}, + }, + "loadBalancerSku": "str", + "natGatewayProfile": { + "effectiveOutboundIPs": [{"id": "str"}], + "idleTimeoutInMinutes": 0, + "managedOutboundIPProfile": {"count": 0}, + }, + "networkDataplane": "str", + "networkMode": "str", + "networkPlugin": "str", + "networkPluginMode": "str", + "networkPolicy": "str", + "outboundType": "str", + "podCidr": "str", + "podCidrs": ["str"], + "podLinkLocalAccess": "str", + "serviceCidr": "str", + "serviceCidrs": ["str"], + "staticEgressGatewayProfile": {"enabled": bool}, + }, + "nodeProvisioningProfile": {"defaultNodePools": "str", "mode": "str"}, + "nodeResourceGroup": "str", + "nodeResourceGroupProfile": {"restrictionLevel": "str"}, + "oidcIssuerProfile": {"enabled": bool, "issuerURL": "str"}, + "podIdentityProfile": { + "allowNetworkPluginKubenet": bool, + "enabled": bool, + "userAssignedIdentities": [ + { + "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, + "name": "str", + "namespace": "str", + "bindingSelector": "str", + "provisioningInfo": { + "error": { + "error": {"code": "str", "details": [...], "message": "str", "target": "str"} + } + }, + "provisioningState": "str", } + ], + "userAssignedIdentityExceptions": [ + {"name": "str", "namespace": "str", "podLabels": {"str": "str"}} + ], + }, + "powerState": {"code": "str"}, + "privateFQDN": "str", + "privateLinkResources": [ + { + "groupId": "str", + "id": "str", + "name": "str", + "privateLinkServiceID": "str", + "requiredMembers": ["str"], + "type": "str", + } + ], + "provisioningState": "str", + "publicNetworkAccess": "str", + "resourceUID": "str", + "schedulerProfile": {"schedulerInstanceProfiles": {"upstream": {"schedulerConfigMode": "str"}}}, + "securityProfile": { + "azureKeyVaultKms": { + "enabled": bool, + "keyId": "str", + "keyVaultNetworkAccess": "str", + "keyVaultResourceId": "str", + }, + "customCATrustCertificates": [bytes("bytes", encoding="utf-8")], + "defender": { + "logAnalyticsWorkspaceResourceId": "str", + "securityGating": { + "allowSecretAccess": bool, + "enabled": bool, + "identities": [ + { + "azureContainerRegistry": "str", + "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, + } + ], + }, + "securityMonitoring": {"enabled": bool}, }, - "components": { - "egressGateways": [ - {"enabled": bool, "name": "str", "gatewayConfigurationName": "str", "namespace": "str"} - ], - "ingressGateways": [{"enabled": bool, "mode": "str"}], - "proxyRedirectionMechanism": "str", + "imageCleaner": {"enabled": bool, "intervalHours": 0}, + "imageIntegrity": {"enabled": bool}, + "kubernetesResourceObjectEncryptionProfile": {"infrastructureEncryption": "str"}, + "nodeRestriction": {"enabled": bool}, + "workloadIdentity": {"enabled": bool}, + }, + "serviceMeshProfile": { + "mode": "str", + "istio": { + "certificateAuthority": { + "plugin": { + "certChainObjectName": "str", + "certObjectName": "str", + "keyObjectName": "str", + "keyVaultId": "str", + "rootCertObjectName": "str", + } + }, + "components": { + "egressGateways": [ + { + "enabled": bool, + "name": "str", + "gatewayConfigurationName": "str", + "namespace": "str", + } + ], + "ingressGateways": [{"enabled": bool, "mode": "str"}], + "proxyRedirectionMechanism": "str", + }, + "revisions": ["str"], }, - "revisions": ["str"], + }, + "servicePrincipalProfile": {"clientId": "str", "secret": "str"}, + "status": { + "provisioningError": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + } + }, + "storageProfile": { + "blobCSIDriver": {"enabled": bool}, + "diskCSIDriver": {"enabled": bool, "version": "str"}, + "fileCSIDriver": {"enabled": bool}, + "snapshotController": {"enabled": bool}, + }, + "supportPlan": "str", + "upgradeSettings": {"overrideSettings": {"forceUpgrade": bool, "until": "2020-02-20 00:00:00"}}, + "windowsProfile": { + "adminUsername": "str", + "adminPassword": "str", + "enableCSIProxy": bool, + "gmsaProfile": {"dnsServer": "str", "enabled": bool, "rootDomainName": "str"}, + "licenseType": "str", + }, + "workloadAutoScalerProfile": { + "keda": {"enabled": bool}, + "verticalPodAutoscaler": {"enabled": bool, "addonAutoscaling": "str"}, }, }, - "servicePrincipalProfile": {"clientId": "str", "secret": "str"}, "sku": {"name": "str", "tier": "str"}, - "status": { - "provisioningError": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - } - }, - "storageProfile": { - "blobCSIDriver": {"enabled": bool}, - "diskCSIDriver": {"enabled": bool, "version": "str"}, - "fileCSIDriver": {"enabled": bool}, - "snapshotController": {"enabled": bool}, - }, - "supportPlan": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -588,20 +515,7 @@ def test_managed_clusters_begin_create_or_update(self, resource_group): }, "tags": {"str": "str"}, "type": "str", - "upgradeSettings": {"overrideSettings": {"forceUpgrade": bool, "until": "2020-02-20 00:00:00"}}, - "windowsProfile": { - "adminUsername": "str", - "adminPassword": "str", - "enableCSIProxy": bool, - "gmsaProfile": {"dnsServer": "str", "enabled": bool, "rootDomainName": "str"}, - "licenseType": "str", - }, - "workloadAutoScalerProfile": { - "keda": {"enabled": bool}, - "verticalPodAutoscaler": {"enabled": False, "addonAutoscaling": "Disabled"}, - }, }, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -614,7 +528,6 @@ def test_managed_clusters_begin_update_tags(self, resource_group): resource_group_name=resource_group.name, resource_name="str", parameters={"tags": {"str": "str"}}, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -626,12 +539,74 @@ def test_managed_clusters_begin_delete(self, resource_group): response = self.client.managed_clusters.begin_delete( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_list_by_resource_group(self, resource_group): + response = self.client.managed_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_list(self, resource_group): + response = self.client.managed_clusters.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_get_access_profile(self, resource_group): + response = self.client.managed_clusters.get_access_profile( + resource_group_name=resource_group.name, + resource_name="str", + role_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_list_cluster_admin_credentials(self, resource_group): + response = self.client.managed_clusters.list_cluster_admin_credentials( + resource_group_name=resource_group.name, + resource_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_list_cluster_user_credentials(self, resource_group): + response = self.client.managed_clusters.list_cluster_user_credentials( + resource_group_name=resource_group.name, + resource_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_list_cluster_monitoring_user_credentials(self, resource_group): + response = self.client.managed_clusters.list_cluster_monitoring_user_credentials( + resource_group_name=resource_group.name, + resource_name="str", + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_clusters_begin_reset_service_principal_profile(self, resource_group): @@ -639,7 +614,6 @@ def test_managed_clusters_begin_reset_service_principal_profile(self, resource_g resource_group_name=resource_group.name, resource_name="str", parameters={"clientId": "str", "secret": "str"}, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -660,7 +634,6 @@ def test_managed_clusters_begin_reset_aad_profile(self, resource_group): "serverAppSecret": "str", "tenantID": "str", }, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -668,11 +641,10 @@ def test_managed_clusters_begin_reset_aad_profile(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_clusters_begin_abort_latest_operation(self, resource_group): - response = self.client.managed_clusters.begin_abort_latest_operation( + def test_managed_clusters_begin_rotate_cluster_certificates(self, resource_group): + response = self.client.managed_clusters.begin_rotate_cluster_certificates( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -680,11 +652,10 @@ def test_managed_clusters_begin_abort_latest_operation(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_clusters_begin_rotate_cluster_certificates(self, resource_group): - response = self.client.managed_clusters.begin_rotate_cluster_certificates( + def test_managed_clusters_begin_abort_latest_operation(self, resource_group): + response = self.client.managed_clusters.begin_abort_latest_operation( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -696,7 +667,6 @@ def test_managed_clusters_begin_rotate_service_account_signing_keys(self, resour response = self.client.managed_clusters.begin_rotate_service_account_signing_keys( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -708,7 +678,6 @@ def test_managed_clusters_begin_stop(self, resource_group): response = self.client.managed_clusters.begin_stop( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -720,7 +689,6 @@ def test_managed_clusters_begin_start(self, resource_group): response = self.client.managed_clusters.begin_start( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -733,7 +701,6 @@ def test_managed_clusters_begin_run_command(self, resource_group): resource_group_name=resource_group.name, resource_name="str", request_payload={"command": "str", "clusterToken": "str", "context": "str"}, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -746,7 +713,6 @@ def test_managed_clusters_get_command_result(self, resource_group): resource_group_name=resource_group.name, resource_name="str", command_id="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -758,19 +724,40 @@ def test_managed_clusters_list_outbound_network_dependencies_endpoints(self, res response = self.client.managed_clusters.list_outbound_network_dependencies_endpoints( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) result = [r for r in response] # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_begin_rebalance_load_balancers(self, resource_group): + response = self.client.managed_clusters.begin_rebalance_load_balancers( + resource_group_name=resource_group.name, + resource_name="str", + parameters={"loadBalancerNames": ["str"]}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_get_upgrade_profile(self, resource_group): + response = self.client.managed_clusters.get_upgrade_profile( + resource_group_name=resource_group.name, + resource_name="str", + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_clusters_get_guardrails_versions(self, resource_group): response = self.client.managed_clusters.get_guardrails_versions( location="str", version="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -781,7 +768,6 @@ def test_managed_clusters_get_guardrails_versions(self, resource_group): def test_managed_clusters_list_guardrails_versions(self, resource_group): response = self.client.managed_clusters.list_guardrails_versions( location="str", - api_version="2025-10-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -793,7 +779,6 @@ def test_managed_clusters_get_safeguards_versions(self, resource_group): response = self.client.managed_clusters.get_safeguards_versions( location="str", version="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -804,18 +789,6 @@ def test_managed_clusters_get_safeguards_versions(self, resource_group): def test_managed_clusters_list_safeguards_versions(self, resource_group): response = self.client.managed_clusters.list_safeguards_versions( location="str", - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_clusters_list_mesh_revision_profiles(self, resource_group): - response = self.client.managed_clusters.list_mesh_revision_profiles( - location="str", - api_version="2025-10-02-preview", ) result = [r for r in response] # please add some check logic here by yourself @@ -827,7 +800,6 @@ def test_managed_clusters_get_mesh_revision_profile(self, resource_group): response = self.client.managed_clusters.get_mesh_revision_profile( location="str", mode="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -835,11 +807,9 @@ def test_managed_clusters_get_mesh_revision_profile(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_clusters_list_mesh_upgrade_profiles(self, resource_group): - response = self.client.managed_clusters.list_mesh_upgrade_profiles( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", + def test_managed_clusters_list_mesh_revision_profiles(self, resource_group): + response = self.client.managed_clusters.list_mesh_revision_profiles( + location="str", ) result = [r for r in response] # please add some check logic here by yourself @@ -852,7 +822,6 @@ def test_managed_clusters_get_mesh_upgrade_profile(self, resource_group): resource_group_name=resource_group.name, resource_name="str", mode="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -860,13 +829,21 @@ def test_managed_clusters_get_mesh_upgrade_profile(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_clusters_begin_rebalance_load_balancers(self, resource_group): - response = self.client.managed_clusters.begin_rebalance_load_balancers( + def test_managed_clusters_list_mesh_upgrade_profiles(self, resource_group): + response = self.client.managed_clusters.list_mesh_upgrade_profiles( resource_group_name=resource_group.name, resource_name="str", - parameters={"loadBalancerNames": ["str"]}, - api_version="2025-10-02-preview", - ).result() # call '.result()' to poll until service return final result + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_clusters_list_kubernetes_versions(self, resource_group): + response = self.client.managed_clusters.list_kubernetes_versions( + location="str", + ) # please add some check logic here by yourself # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations_async.py index aa0c222682fa..9644718de9f5 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_clusters_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,106 +19,12 @@ class TestContainerServiceManagedClustersOperationsAsync(AzureMgmtRecordedTestCa def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_clusters_list_kubernetes_versions(self, resource_group): - response = await self.client.managed_clusters.list_kubernetes_versions( - location="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_clusters_list(self, resource_group): - response = self.client.managed_clusters.list( - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_clusters_list_by_resource_group(self, resource_group): - response = self.client.managed_clusters.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_clusters_get_upgrade_profile(self, resource_group): - response = await self.client.managed_clusters.get_upgrade_profile( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_clusters_get_access_profile(self, resource_group): - response = await self.client.managed_clusters.get_access_profile( - resource_group_name=resource_group.name, - resource_name="str", - role_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_clusters_list_cluster_admin_credentials(self, resource_group): - response = await self.client.managed_clusters.list_cluster_admin_credentials( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_clusters_list_cluster_user_credentials(self, resource_group): - response = await self.client.managed_clusters.list_cluster_user_credentials( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_clusters_list_cluster_monitoring_user_credentials(self, resource_group): - response = await self.client.managed_clusters.list_cluster_monitoring_user_credentials( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_clusters_get(self, resource_group): response = await self.client.managed_clusters.get( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -133,262 +39,8 @@ async def test_managed_clusters_begin_create_or_update(self, resource_group): resource_name="str", parameters={ "location": "str", - "aadProfile": { - "adminGroupObjectIDs": ["str"], - "clientAppID": "str", - "enableAzureRBAC": bool, - "managed": bool, - "serverAppID": "str", - "serverAppSecret": "str", - "tenantID": "str", - }, - "addonProfiles": { - "str": { - "enabled": bool, - "config": {"str": "str"}, - "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, - } - }, - "agentPoolProfiles": [ - { - "name": "str", - "artifactStreamingProfile": {"enabled": bool}, - "availabilityZones": ["str"], - "capacityReservationGroupID": "str", - "count": 0, - "creationData": {"sourceResourceId": "str"}, - "currentOrchestratorVersion": "str", - "eTag": "str", - "enableAutoScaling": bool, - "enableEncryptionAtHost": bool, - "enableFIPS": bool, - "enableNodePublicIP": bool, - "enableUltraSSD": bool, - "gatewayProfile": {"publicIPPrefixSize": 31}, - "gpuInstanceProfile": "str", - "gpuProfile": {"driver": "str", "driverType": "str"}, - "hostGroupID": "str", - "kubeletConfig": { - "allowedUnsafeSysctls": ["str"], - "containerLogMaxFiles": 0, - "containerLogMaxSizeMB": 0, - "cpuCfsQuota": bool, - "cpuCfsQuotaPeriod": "str", - "cpuManagerPolicy": "str", - "failSwapOn": bool, - "imageGcHighThreshold": 0, - "imageGcLowThreshold": 0, - "podMaxPids": 0, - "seccompDefault": "str", - "topologyManagerPolicy": "str", - }, - "kubeletDiskType": "str", - "linuxOSConfig": { - "swapFileSizeMB": 0, - "sysctls": { - "fsAioMaxNr": 0, - "fsFileMax": 0, - "fsInotifyMaxUserWatches": 0, - "fsNrOpen": 0, - "kernelThreadsMax": 0, - "netCoreNetdevMaxBacklog": 0, - "netCoreOptmemMax": 0, - "netCoreRmemDefault": 0, - "netCoreRmemMax": 0, - "netCoreSomaxconn": 0, - "netCoreWmemDefault": 0, - "netCoreWmemMax": 0, - "netIpv4IpLocalPortRange": "str", - "netIpv4NeighDefaultGcThresh1": 0, - "netIpv4NeighDefaultGcThresh2": 0, - "netIpv4NeighDefaultGcThresh3": 0, - "netIpv4TcpFinTimeout": 0, - "netIpv4TcpKeepaliveProbes": 0, - "netIpv4TcpKeepaliveTime": 0, - "netIpv4TcpMaxSynBacklog": 0, - "netIpv4TcpMaxTwBuckets": 0, - "netIpv4TcpTwReuse": bool, - "netIpv4TcpkeepaliveIntvl": 0, - "netNetfilterNfConntrackBuckets": 0, - "netNetfilterNfConntrackMax": 0, - "vmMaxMapCount": 0, - "vmSwappiness": 0, - "vmVfsCachePressure": 0, - }, - "transparentHugePageDefrag": "str", - "transparentHugePageEnabled": "str", - }, - "localDNSProfile": { - "kubeDNSOverrides": { - "str": { - "cacheDurationInSeconds": 3600, - "forwardDestination": "ClusterCoreDNS", - "forwardPolicy": "Sequential", - "maxConcurrent": 1000, - "protocol": "PreferUDP", - "queryLogging": "Error", - "serveStale": "Immediate", - "serveStaleDurationInSeconds": 3600, - } - }, - "mode": "Preferred", - "state": "str", - "vnetDNSOverrides": { - "str": { - "cacheDurationInSeconds": 3600, - "forwardDestination": "ClusterCoreDNS", - "forwardPolicy": "Sequential", - "maxConcurrent": 1000, - "protocol": "PreferUDP", - "queryLogging": "Error", - "serveStale": "Immediate", - "serveStaleDurationInSeconds": 3600, - } - }, - }, - "maxCount": 0, - "maxPods": 0, - "messageOfTheDay": "str", - "minCount": 0, - "mode": "str", - "networkProfile": { - "allowedHostPorts": [{"portEnd": 0, "portStart": 0, "protocol": "str"}], - "applicationSecurityGroups": ["str"], - "nodePublicIPTags": [{"ipTagType": "str", "tag": "str"}], - }, - "nodeCustomizationProfile": {"nodeCustomizationId": "str"}, - "nodeImageVersion": "str", - "nodeInitializationTaints": ["str"], - "nodeLabels": {"str": "str"}, - "nodePublicIPPrefixID": "str", - "nodeTaints": ["str"], - "orchestratorVersion": "str", - "osDiskSizeGB": 0, - "osDiskType": "str", - "osSKU": "str", - "osType": "Linux", - "podIPAllocationMode": "str", - "podSubnetID": "str", - "powerState": {"code": "str"}, - "provisioningState": "str", - "proximityPlacementGroupID": "str", - "scaleDownMode": "str", - "scaleSetEvictionPolicy": "Delete", - "scaleSetPriority": "Regular", - "securityProfile": {"enableSecureBoot": bool, "enableVTPM": bool, "sshAccess": "str"}, - "spotMaxPrice": -1, - "status": { - "provisioningError": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - } - }, - "tags": {"str": "str"}, - "type": "str", - "upgradeSettings": { - "drainTimeoutInMinutes": 0, - "maxBlockedNodes": "str", - "maxSurge": "str", - "maxUnavailable": "str", - "nodeSoakDurationInMinutes": 0, - "undrainableNodeBehavior": "str", - }, - "upgradeSettingsBlueGreen": { - "batchSoakDurationInMinutes": 0, - "drainBatchSize": "str", - "drainTimeoutInMinutes": 0, - "finalSoakDurationInMinutes": 0, - }, - "upgradeStrategy": "str", - "virtualMachineNodesStatus": [{"count": 0, "size": "str"}], - "virtualMachinesProfile": { - "scale": { - "autoscale": {"maxCount": 0, "minCount": 0, "size": "str"}, - "manual": [{"count": 0, "size": "str"}], - } - }, - "vmSize": "str", - "vnetSubnetID": "str", - "windowsProfile": {"disableOutboundNat": bool}, - "workloadRuntime": "str", - } - ], - "aiToolchainOperatorProfile": {"enabled": bool}, - "apiServerAccessProfile": { - "authorizedIPRanges": ["str"], - "disableRunCommand": bool, - "enablePrivateCluster": bool, - "enablePrivateClusterPublicFQDN": bool, - "enableVnetIntegration": bool, - "privateDNSZone": "str", - "subnetId": "str", - }, - "autoScalerProfile": { - "balance-similar-node-groups": "str", - "daemonset-eviction-for-empty-nodes": bool, - "daemonset-eviction-for-occupied-nodes": bool, - "expander": "str", - "ignore-daemonsets-utilization": bool, - "max-empty-bulk-delete": "str", - "max-graceful-termination-sec": "str", - "max-node-provision-time": "str", - "max-total-unready-percentage": "str", - "new-pod-scale-up-delay": "str", - "ok-total-unready-count": "str", - "scale-down-delay-after-add": "str", - "scale-down-delay-after-delete": "str", - "scale-down-delay-after-failure": "str", - "scale-down-unneeded-time": "str", - "scale-down-unready-time": "str", - "scale-down-utilization-threshold": "str", - "scan-interval": "str", - "skip-nodes-with-local-storage": "str", - "skip-nodes-with-system-pods": "str", - }, - "autoUpgradeProfile": {"nodeOSUpgradeChannel": "str", "upgradeChannel": "str"}, - "azureMonitorProfile": { - "appMonitoring": { - "autoInstrumentation": {"enabled": bool}, - "openTelemetryLogs": {"enabled": bool, "port": 0}, - "openTelemetryMetrics": {"enabled": bool, "port": 0}, - }, - "containerInsights": { - "disableCustomMetrics": bool, - "disablePrometheusMetricsScraping": bool, - "enabled": bool, - "logAnalyticsWorkspaceResourceId": "str", - "syslogPort": 0, - }, - "metrics": { - "enabled": bool, - "kubeStateMetrics": {"metricAnnotationsAllowList": "str", "metricLabelsAllowlist": "str"}, - }, - }, - "azurePortalFQDN": "str", - "bootstrapProfile": {"artifactSource": "Direct", "containerRegistryId": "str"}, - "creationData": {"sourceResourceId": "str"}, - "currentKubernetesVersion": "str", - "disableLocalAccounts": bool, - "diskEncryptionSetID": "str", - "dnsPrefix": "str", "eTag": "str", - "enableNamespaceResources": bool, - "enableRBAC": bool, "extendedLocation": {"name": "str", "type": "str"}, - "fqdn": "str", - "fqdnSubdomain": "str", - "hostedSystemProfile": {"enabled": bool}, - "httpProxyConfig": { - "effectiveNoProxy": ["str"], - "enabled": bool, - "httpProxy": "str", - "httpsProxy": "str", - "noProxy": ["str"], - "trustedCa": "str", - }, "id": "str", "identity": { "delegatedResources": { @@ -404,194 +56,470 @@ async def test_managed_clusters_begin_create_or_update(self, resource_group): "type": "str", "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, - "identityProfile": {"str": {"clientId": "str", "objectId": "str", "resourceId": "str"}}, - "ingressProfile": { - "applicationLoadBalancer": { - "enabled": bool, - "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, - }, - "gatewayAPI": {"installation": "str"}, - "webAppRouting": { - "defaultDomain": {"domainName": "str", "enabled": bool}, - "dnsZoneResourceIds": ["str"], - "enabled": bool, - "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, - "nginx": {"defaultIngressControllerType": "str"}, - }, - }, "kind": "str", - "kubernetesVersion": "str", - "linuxProfile": {"adminUsername": "str", "ssh": {"publicKeys": [{"keyData": "str"}]}}, - "maxAgentPools": 0, - "metricsProfile": {"costAnalysis": {"enabled": bool}}, "name": "str", - "networkProfile": { - "advancedNetworking": { - "enabled": bool, - "observability": {"enabled": bool}, - "performance": {"accelerationMode": "None"}, - "security": { - "advancedNetworkPolicies": "str", - "enabled": bool, - "transitEncryption": {"type": "str"}, - }, + "properties": { + "aadProfile": { + "adminGroupObjectIDs": ["str"], + "clientAppID": "str", + "enableAzureRBAC": bool, + "managed": bool, + "serverAppID": "str", + "serverAppSecret": "str", + "tenantID": "str", }, - "dnsServiceIP": "10.0.0.10", - "ipFamilies": ["str"], - "kubeProxyConfig": { - "enabled": bool, - "ipvsConfig": { - "scheduler": "str", - "tcpFinTimeoutSeconds": 0, - "tcpTimeoutSeconds": 0, - "udpTimeoutSeconds": 0, - }, - "mode": "str", - }, - "loadBalancerProfile": { - "allocatedOutboundPorts": 0, - "backendPoolType": "NodeIPConfiguration", - "clusterServiceLoadBalancerHealthProbeMode": "ServiceNodePort", - "effectiveOutboundIPs": [{"id": "str"}], - "enableMultipleStandardLoadBalancers": bool, - "idleTimeoutInMinutes": 30, - "managedOutboundIPs": {"count": 1, "countIPv6": 0}, - "outboundIPPrefixes": {"publicIPPrefixes": [{"id": "str"}]}, - "outboundIPs": {"publicIPs": [{"id": "str"}]}, - }, - "loadBalancerSku": "str", - "natGatewayProfile": { - "effectiveOutboundIPs": [{"id": "str"}], - "idleTimeoutInMinutes": 4, - "managedOutboundIPProfile": {"count": 1}, + "addonProfiles": { + "str": { + "enabled": bool, + "config": {"str": "str"}, + "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, + } }, - "networkDataplane": "str", - "networkMode": "str", - "networkPlugin": "str", - "networkPluginMode": "str", - "networkPolicy": "str", - "outboundType": "loadBalancer", - "podCidr": "10.244.0.0/16", - "podCidrs": ["str"], - "podLinkLocalAccess": "str", - "serviceCidr": "10.0.0.0/16", - "serviceCidrs": ["str"], - "staticEgressGatewayProfile": {"enabled": bool}, - }, - "nodeProvisioningProfile": {"defaultNodePools": "Auto", "mode": "str"}, - "nodeResourceGroup": "str", - "nodeResourceGroupProfile": {"restrictionLevel": "str"}, - "oidcIssuerProfile": {"enabled": bool, "issuerURL": "str"}, - "podIdentityProfile": { - "allowNetworkPluginKubenet": bool, - "enabled": bool, - "userAssignedIdentities": [ + "agentPoolProfiles": [ { - "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, "name": "str", - "namespace": "str", - "bindingSelector": "str", - "provisioningInfo": { - "error": { - "error": {"code": "str", "details": [...], "message": "str", "target": "str"} - } + "artifactStreamingProfile": {"enabled": bool}, + "availabilityZones": ["str"], + "capacityReservationGroupID": "str", + "count": 0, + "creationData": {"sourceResourceId": "str"}, + "currentOrchestratorVersion": "str", + "eTag": "str", + "enableAutoScaling": bool, + "enableEncryptionAtHost": bool, + "enableFIPS": bool, + "enableNodePublicIP": bool, + "enableUltraSSD": bool, + "gatewayProfile": {"publicIPPrefixSize": 0}, + "gpuInstanceProfile": "str", + "gpuProfile": {"driver": "str", "driverType": "str"}, + "hostGroupID": "str", + "kubeletConfig": { + "allowedUnsafeSysctls": ["str"], + "containerLogMaxFiles": 0, + "containerLogMaxSizeMB": 0, + "cpuCfsQuota": bool, + "cpuCfsQuotaPeriod": "str", + "cpuManagerPolicy": "str", + "failSwapOn": bool, + "imageGcHighThreshold": 0, + "imageGcLowThreshold": 0, + "podMaxPids": 0, + "seccompDefault": "str", + "topologyManagerPolicy": "str", }, + "kubeletDiskType": "str", + "linuxOSConfig": { + "swapFileSizeMB": 0, + "sysctls": { + "fsAioMaxNr": 0, + "fsFileMax": 0, + "fsInotifyMaxUserWatches": 0, + "fsNrOpen": 0, + "kernelThreadsMax": 0, + "netCoreNetdevMaxBacklog": 0, + "netCoreOptmemMax": 0, + "netCoreRmemDefault": 0, + "netCoreRmemMax": 0, + "netCoreSomaxconn": 0, + "netCoreWmemDefault": 0, + "netCoreWmemMax": 0, + "netIpv4IpLocalPortRange": "str", + "netIpv4NeighDefaultGcThresh1": 0, + "netIpv4NeighDefaultGcThresh2": 0, + "netIpv4NeighDefaultGcThresh3": 0, + "netIpv4TcpFinTimeout": 0, + "netIpv4TcpKeepaliveProbes": 0, + "netIpv4TcpKeepaliveTime": 0, + "netIpv4TcpMaxSynBacklog": 0, + "netIpv4TcpMaxTwBuckets": 0, + "netIpv4TcpTwReuse": bool, + "netIpv4TcpkeepaliveIntvl": 0, + "netNetfilterNfConntrackBuckets": 0, + "netNetfilterNfConntrackMax": 0, + "vmMaxMapCount": 0, + "vmSwappiness": 0, + "vmVfsCachePressure": 0, + }, + "transparentHugePageDefrag": "str", + "transparentHugePageEnabled": "str", + }, + "localDNSProfile": { + "kubeDNSOverrides": { + "str": { + "cacheDurationInSeconds": 0, + "forwardDestination": "str", + "forwardPolicy": "str", + "maxConcurrent": 0, + "protocol": "str", + "queryLogging": "str", + "serveStale": "str", + "serveStaleDurationInSeconds": 0, + } + }, + "mode": "str", + "state": "str", + "vnetDNSOverrides": { + "str": { + "cacheDurationInSeconds": 0, + "forwardDestination": "str", + "forwardPolicy": "str", + "maxConcurrent": 0, + "protocol": "str", + "queryLogging": "str", + "serveStale": "str", + "serveStaleDurationInSeconds": 0, + } + }, + }, + "maxCount": 0, + "maxPods": 0, + "messageOfTheDay": "str", + "minCount": 0, + "mode": "str", + "networkProfile": { + "allowedHostPorts": [{"portEnd": 0, "portStart": 0, "protocol": "str"}], + "applicationSecurityGroups": ["str"], + "nodePublicIPTags": [{"ipTagType": "str", "tag": "str"}], + }, + "nodeCustomizationProfile": {"nodeCustomizationId": "str"}, + "nodeImageVersion": "str", + "nodeInitializationTaints": ["str"], + "nodeLabels": {"str": "str"}, + "nodePublicIPPrefixID": "str", + "nodeTaints": ["str"], + "orchestratorVersion": "str", + "osDiskSizeGB": 0, + "osDiskType": "str", + "osSKU": "str", + "osType": "str", + "podIPAllocationMode": "str", + "podSubnetID": "str", + "powerState": {"code": "str"}, "provisioningState": "str", + "proximityPlacementGroupID": "str", + "scaleDownMode": "str", + "scaleSetEvictionPolicy": "str", + "scaleSetPriority": "str", + "securityProfile": {"enableSecureBoot": bool, "enableVTPM": bool, "sshAccess": "str"}, + "spotMaxPrice": 0.0, + "status": { + "provisioningError": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + } + }, + "tags": {"str": "str"}, + "type": "str", + "upgradeSettings": { + "drainTimeoutInMinutes": 0, + "maxBlockedNodes": "str", + "maxSurge": "str", + "maxUnavailable": "str", + "nodeSoakDurationInMinutes": 0, + "undrainableNodeBehavior": "str", + }, + "upgradeSettingsBlueGreen": { + "batchSoakDurationInMinutes": 0, + "drainBatchSize": "str", + "drainTimeoutInMinutes": 0, + "finalSoakDurationInMinutes": 0, + }, + "upgradeStrategy": "str", + "virtualMachineNodesStatus": [{"count": 0, "size": "str"}], + "virtualMachinesProfile": { + "scale": { + "autoscale": {"maxCount": 0, "minCount": 0, "size": "str"}, + "manual": [{"count": 0, "size": "str"}], + } + }, + "vmSize": "str", + "vnetSubnetID": "str", + "windowsProfile": {"disableOutboundNat": bool}, + "workloadRuntime": "str", } ], - "userAssignedIdentityExceptions": [ - {"name": "str", "namespace": "str", "podLabels": {"str": "str"}} - ], - }, - "powerState": {"code": "str"}, - "privateFQDN": "str", - "privateLinkResources": [ - { - "groupId": "str", - "id": "str", - "name": "str", - "privateLinkServiceID": "str", - "requiredMembers": ["str"], - "type": "str", - } - ], - "provisioningState": "str", - "publicNetworkAccess": "str", - "resourceUID": "str", - "schedulerProfile": {"schedulerInstanceProfiles": {"upstream": {"schedulerConfigMode": "str"}}}, - "securityProfile": { - "azureKeyVaultKms": { + "aiToolchainOperatorProfile": {"enabled": bool}, + "apiServerAccessProfile": { + "authorizedIPRanges": ["str"], + "disableRunCommand": bool, + "enablePrivateCluster": bool, + "enablePrivateClusterPublicFQDN": bool, + "enableVnetIntegration": bool, + "privateDNSZone": "str", + "subnetId": "str", + }, + "autoScalerProfile": { + "balance-similar-node-groups": "str", + "daemonset-eviction-for-empty-nodes": bool, + "daemonset-eviction-for-occupied-nodes": bool, + "expander": "str", + "ignore-daemonsets-utilization": bool, + "max-empty-bulk-delete": "str", + "max-graceful-termination-sec": "str", + "max-node-provision-time": "str", + "max-total-unready-percentage": "str", + "new-pod-scale-up-delay": "str", + "ok-total-unready-count": "str", + "scale-down-delay-after-add": "str", + "scale-down-delay-after-delete": "str", + "scale-down-delay-after-failure": "str", + "scale-down-unneeded-time": "str", + "scale-down-unready-time": "str", + "scale-down-utilization-threshold": "str", + "scan-interval": "str", + "skip-nodes-with-local-storage": "str", + "skip-nodes-with-system-pods": "str", + }, + "autoUpgradeProfile": {"nodeOSUpgradeChannel": "str", "upgradeChannel": "str"}, + "azureMonitorProfile": { + "appMonitoring": { + "autoInstrumentation": {"enabled": bool}, + "openTelemetryLogs": {"enabled": bool, "port": 0}, + "openTelemetryMetrics": {"enabled": bool, "port": 0}, + }, + "containerInsights": { + "disableCustomMetrics": bool, + "disablePrometheusMetricsScraping": bool, + "enabled": bool, + "logAnalyticsWorkspaceResourceId": "str", + "syslogPort": 0, + }, + "metrics": { + "enabled": bool, + "kubeStateMetrics": { + "metricAnnotationsAllowList": "str", + "metricLabelsAllowlist": "str", + }, + }, + }, + "azurePortalFQDN": "str", + "bootstrapProfile": {"artifactSource": "str", "containerRegistryId": "str"}, + "creationData": {"sourceResourceId": "str"}, + "currentKubernetesVersion": "str", + "disableLocalAccounts": bool, + "diskEncryptionSetID": "str", + "dnsPrefix": "str", + "enableNamespaceResources": bool, + "enableRBAC": bool, + "fqdn": "str", + "fqdnSubdomain": "str", + "hostedSystemProfile": {"enabled": bool}, + "httpProxyConfig": { + "effectiveNoProxy": ["str"], "enabled": bool, - "keyId": "str", - "keyVaultNetworkAccess": "Public", - "keyVaultResourceId": "str", + "httpProxy": "str", + "httpsProxy": "str", + "noProxy": ["str"], + "trustedCa": "str", }, - "customCATrustCertificates": [bytes("bytes", encoding="utf-8")], - "defender": { - "logAnalyticsWorkspaceResourceId": "str", - "securityGating": { - "allowSecretAccess": bool, + "identityProfile": {"str": {"clientId": "str", "objectId": "str", "resourceId": "str"}}, + "ingressProfile": { + "applicationLoadBalancer": { "enabled": bool, - "identities": [ - { - "azureContainerRegistry": "str", - "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, - } - ], + "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, + }, + "gatewayAPI": {"installation": "str"}, + "webAppRouting": { + "defaultDomain": {"domainName": "str", "enabled": bool}, + "dnsZoneResourceIds": ["str"], + "enabled": bool, + "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, + "nginx": {"defaultIngressControllerType": "str"}, }, - "securityMonitoring": {"enabled": bool}, }, - "imageCleaner": {"enabled": bool, "intervalHours": 0}, - "imageIntegrity": {"enabled": bool}, - "kubernetesResourceObjectEncryptionProfile": {"infrastructureEncryption": "Disabled"}, - "nodeRestriction": {"enabled": bool}, - "workloadIdentity": {"enabled": bool}, - }, - "serviceMeshProfile": { - "mode": "str", - "istio": { - "certificateAuthority": { - "plugin": { - "certChainObjectName": "str", - "certObjectName": "str", - "keyObjectName": "str", - "keyVaultId": "str", - "rootCertObjectName": "str", + "kubernetesVersion": "str", + "linuxProfile": {"adminUsername": "str", "ssh": {"publicKeys": [{"keyData": "str"}]}}, + "maxAgentPools": 0, + "metricsProfile": {"costAnalysis": {"enabled": bool}}, + "networkProfile": { + "advancedNetworking": { + "enabled": bool, + "observability": {"enabled": bool}, + "performance": {"accelerationMode": "str"}, + "security": { + "advancedNetworkPolicies": "str", + "enabled": bool, + "transitEncryption": {"type": "str"}, + }, + }, + "dnsServiceIP": "str", + "ipFamilies": ["str"], + "kubeProxyConfig": { + "enabled": bool, + "ipvsConfig": { + "scheduler": "str", + "tcpFinTimeoutSeconds": 0, + "tcpTimeoutSeconds": 0, + "udpTimeoutSeconds": 0, + }, + "mode": "str", + }, + "loadBalancerProfile": { + "allocatedOutboundPorts": 0, + "backendPoolType": "str", + "clusterServiceLoadBalancerHealthProbeMode": "str", + "effectiveOutboundIPs": [{"id": "str"}], + "enableMultipleStandardLoadBalancers": bool, + "idleTimeoutInMinutes": 0, + "managedOutboundIPs": {"count": 0, "countIPv6": 0}, + "outboundIPPrefixes": {"publicIPPrefixes": [{"id": "str"}]}, + "outboundIPs": {"publicIPs": [{"id": "str"}]}, + }, + "loadBalancerSku": "str", + "natGatewayProfile": { + "effectiveOutboundIPs": [{"id": "str"}], + "idleTimeoutInMinutes": 0, + "managedOutboundIPProfile": {"count": 0}, + }, + "networkDataplane": "str", + "networkMode": "str", + "networkPlugin": "str", + "networkPluginMode": "str", + "networkPolicy": "str", + "outboundType": "str", + "podCidr": "str", + "podCidrs": ["str"], + "podLinkLocalAccess": "str", + "serviceCidr": "str", + "serviceCidrs": ["str"], + "staticEgressGatewayProfile": {"enabled": bool}, + }, + "nodeProvisioningProfile": {"defaultNodePools": "str", "mode": "str"}, + "nodeResourceGroup": "str", + "nodeResourceGroupProfile": {"restrictionLevel": "str"}, + "oidcIssuerProfile": {"enabled": bool, "issuerURL": "str"}, + "podIdentityProfile": { + "allowNetworkPluginKubenet": bool, + "enabled": bool, + "userAssignedIdentities": [ + { + "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, + "name": "str", + "namespace": "str", + "bindingSelector": "str", + "provisioningInfo": { + "error": { + "error": { + "code": "str", + "details": [...], + "message": "str", + "target": "str", + } + } + }, + "provisioningState": "str", } + ], + "userAssignedIdentityExceptions": [ + {"name": "str", "namespace": "str", "podLabels": {"str": "str"}} + ], + }, + "powerState": {"code": "str"}, + "privateFQDN": "str", + "privateLinkResources": [ + { + "groupId": "str", + "id": "str", + "name": "str", + "privateLinkServiceID": "str", + "requiredMembers": ["str"], + "type": "str", + } + ], + "provisioningState": "str", + "publicNetworkAccess": "str", + "resourceUID": "str", + "schedulerProfile": {"schedulerInstanceProfiles": {"upstream": {"schedulerConfigMode": "str"}}}, + "securityProfile": { + "azureKeyVaultKms": { + "enabled": bool, + "keyId": "str", + "keyVaultNetworkAccess": "str", + "keyVaultResourceId": "str", + }, + "customCATrustCertificates": [bytes("bytes", encoding="utf-8")], + "defender": { + "logAnalyticsWorkspaceResourceId": "str", + "securityGating": { + "allowSecretAccess": bool, + "enabled": bool, + "identities": [ + { + "azureContainerRegistry": "str", + "identity": {"clientId": "str", "objectId": "str", "resourceId": "str"}, + } + ], + }, + "securityMonitoring": {"enabled": bool}, }, - "components": { - "egressGateways": [ - { - "enabled": bool, - "name": "str", - "gatewayConfigurationName": "str", - "namespace": "str", + "imageCleaner": {"enabled": bool, "intervalHours": 0}, + "imageIntegrity": {"enabled": bool}, + "kubernetesResourceObjectEncryptionProfile": {"infrastructureEncryption": "str"}, + "nodeRestriction": {"enabled": bool}, + "workloadIdentity": {"enabled": bool}, + }, + "serviceMeshProfile": { + "mode": "str", + "istio": { + "certificateAuthority": { + "plugin": { + "certChainObjectName": "str", + "certObjectName": "str", + "keyObjectName": "str", + "keyVaultId": "str", + "rootCertObjectName": "str", } - ], - "ingressGateways": [{"enabled": bool, "mode": "str"}], - "proxyRedirectionMechanism": "str", + }, + "components": { + "egressGateways": [ + { + "enabled": bool, + "name": "str", + "gatewayConfigurationName": "str", + "namespace": "str", + } + ], + "ingressGateways": [{"enabled": bool, "mode": "str"}], + "proxyRedirectionMechanism": "str", + }, + "revisions": ["str"], }, - "revisions": ["str"], + }, + "servicePrincipalProfile": {"clientId": "str", "secret": "str"}, + "status": { + "provisioningError": { + "additionalInfo": [{"info": {}, "type": "str"}], + "code": "str", + "details": [...], + "message": "str", + "target": "str", + } + }, + "storageProfile": { + "blobCSIDriver": {"enabled": bool}, + "diskCSIDriver": {"enabled": bool, "version": "str"}, + "fileCSIDriver": {"enabled": bool}, + "snapshotController": {"enabled": bool}, + }, + "supportPlan": "str", + "upgradeSettings": {"overrideSettings": {"forceUpgrade": bool, "until": "2020-02-20 00:00:00"}}, + "windowsProfile": { + "adminUsername": "str", + "adminPassword": "str", + "enableCSIProxy": bool, + "gmsaProfile": {"dnsServer": "str", "enabled": bool, "rootDomainName": "str"}, + "licenseType": "str", + }, + "workloadAutoScalerProfile": { + "keda": {"enabled": bool}, + "verticalPodAutoscaler": {"enabled": bool, "addonAutoscaling": "str"}, }, }, - "servicePrincipalProfile": {"clientId": "str", "secret": "str"}, "sku": {"name": "str", "tier": "str"}, - "status": { - "provisioningError": { - "additionalInfo": [{"info": {}, "type": "str"}], - "code": "str", - "details": [...], - "message": "str", - "target": "str", - } - }, - "storageProfile": { - "blobCSIDriver": {"enabled": bool}, - "diskCSIDriver": {"enabled": bool, "version": "str"}, - "fileCSIDriver": {"enabled": bool}, - "snapshotController": {"enabled": bool}, - }, - "supportPlan": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -602,20 +530,7 @@ async def test_managed_clusters_begin_create_or_update(self, resource_group): }, "tags": {"str": "str"}, "type": "str", - "upgradeSettings": {"overrideSettings": {"forceUpgrade": bool, "until": "2020-02-20 00:00:00"}}, - "windowsProfile": { - "adminUsername": "str", - "adminPassword": "str", - "enableCSIProxy": bool, - "gmsaProfile": {"dnsServer": "str", "enabled": bool, "rootDomainName": "str"}, - "licenseType": "str", - }, - "workloadAutoScalerProfile": { - "keda": {"enabled": bool}, - "verticalPodAutoscaler": {"enabled": False, "addonAutoscaling": "Disabled"}, - }, }, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -630,7 +545,6 @@ async def test_managed_clusters_begin_update_tags(self, resource_group): resource_group_name=resource_group.name, resource_name="str", parameters={"tags": {"str": "str"}}, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -644,13 +558,75 @@ async def test_managed_clusters_begin_delete(self, resource_group): await self.client.managed_clusters.begin_delete( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_list_by_resource_group(self, resource_group): + response = self.client.managed_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_list(self, resource_group): + response = self.client.managed_clusters.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_get_access_profile(self, resource_group): + response = await self.client.managed_clusters.get_access_profile( + resource_group_name=resource_group.name, + resource_name="str", + role_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_list_cluster_admin_credentials(self, resource_group): + response = await self.client.managed_clusters.list_cluster_admin_credentials( + resource_group_name=resource_group.name, + resource_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_list_cluster_user_credentials(self, resource_group): + response = await self.client.managed_clusters.list_cluster_user_credentials( + resource_group_name=resource_group.name, + resource_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_list_cluster_monitoring_user_credentials(self, resource_group): + response = await self.client.managed_clusters.list_cluster_monitoring_user_credentials( + resource_group_name=resource_group.name, + resource_name="str", + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_clusters_begin_reset_service_principal_profile(self, resource_group): @@ -659,7 +635,6 @@ async def test_managed_clusters_begin_reset_service_principal_profile(self, reso resource_group_name=resource_group.name, resource_name="str", parameters={"clientId": "str", "secret": "str"}, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -682,7 +657,6 @@ async def test_managed_clusters_begin_reset_aad_profile(self, resource_group): "serverAppSecret": "str", "tenantID": "str", }, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -691,12 +665,11 @@ async def test_managed_clusters_begin_reset_aad_profile(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_clusters_begin_abort_latest_operation(self, resource_group): + async def test_managed_clusters_begin_rotate_cluster_certificates(self, resource_group): response = await ( - await self.client.managed_clusters.begin_abort_latest_operation( + await self.client.managed_clusters.begin_rotate_cluster_certificates( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -705,12 +678,11 @@ async def test_managed_clusters_begin_abort_latest_operation(self, resource_grou @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_clusters_begin_rotate_cluster_certificates(self, resource_group): + async def test_managed_clusters_begin_abort_latest_operation(self, resource_group): response = await ( - await self.client.managed_clusters.begin_rotate_cluster_certificates( + await self.client.managed_clusters.begin_abort_latest_operation( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -724,7 +696,6 @@ async def test_managed_clusters_begin_rotate_service_account_signing_keys(self, await self.client.managed_clusters.begin_rotate_service_account_signing_keys( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -738,7 +709,6 @@ async def test_managed_clusters_begin_stop(self, resource_group): await self.client.managed_clusters.begin_stop( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -752,7 +722,6 @@ async def test_managed_clusters_begin_start(self, resource_group): await self.client.managed_clusters.begin_start( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -767,7 +736,6 @@ async def test_managed_clusters_begin_run_command(self, resource_group): resource_group_name=resource_group.name, resource_name="str", request_payload={"command": "str", "clusterToken": "str", "context": "str"}, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -781,7 +749,6 @@ async def test_managed_clusters_get_command_result(self, resource_group): resource_group_name=resource_group.name, resource_name="str", command_id="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -793,19 +760,42 @@ async def test_managed_clusters_list_outbound_network_dependencies_endpoints(sel response = self.client.managed_clusters.list_outbound_network_dependencies_endpoints( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_begin_rebalance_load_balancers(self, resource_group): + response = await ( + await self.client.managed_clusters.begin_rebalance_load_balancers( + resource_group_name=resource_group.name, + resource_name="str", + parameters={"loadBalancerNames": ["str"]}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_get_upgrade_profile(self, resource_group): + response = await self.client.managed_clusters.get_upgrade_profile( + resource_group_name=resource_group.name, + resource_name="str", + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_clusters_get_guardrails_versions(self, resource_group): response = await self.client.managed_clusters.get_guardrails_versions( location="str", version="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -816,7 +806,6 @@ async def test_managed_clusters_get_guardrails_versions(self, resource_group): async def test_managed_clusters_list_guardrails_versions(self, resource_group): response = self.client.managed_clusters.list_guardrails_versions( location="str", - api_version="2025-10-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -828,7 +817,6 @@ async def test_managed_clusters_get_safeguards_versions(self, resource_group): response = await self.client.managed_clusters.get_safeguards_versions( location="str", version="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -839,18 +827,6 @@ async def test_managed_clusters_get_safeguards_versions(self, resource_group): async def test_managed_clusters_list_safeguards_versions(self, resource_group): response = self.client.managed_clusters.list_safeguards_versions( location="str", - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_clusters_list_mesh_revision_profiles(self, resource_group): - response = self.client.managed_clusters.list_mesh_revision_profiles( - location="str", - api_version="2025-10-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself @@ -862,7 +838,6 @@ async def test_managed_clusters_get_mesh_revision_profile(self, resource_group): response = await self.client.managed_clusters.get_mesh_revision_profile( location="str", mode="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -870,11 +845,9 @@ async def test_managed_clusters_get_mesh_revision_profile(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_clusters_list_mesh_upgrade_profiles(self, resource_group): - response = self.client.managed_clusters.list_mesh_upgrade_profiles( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", + async def test_managed_clusters_list_mesh_revision_profiles(self, resource_group): + response = self.client.managed_clusters.list_mesh_revision_profiles( + location="str", ) result = [r async for r in response] # please add some check logic here by yourself @@ -887,7 +860,6 @@ async def test_managed_clusters_get_mesh_upgrade_profile(self, resource_group): resource_group_name=resource_group.name, resource_name="str", mode="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -895,15 +867,21 @@ async def test_managed_clusters_get_mesh_upgrade_profile(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_clusters_begin_rebalance_load_balancers(self, resource_group): - response = await ( - await self.client.managed_clusters.begin_rebalance_load_balancers( - resource_group_name=resource_group.name, - resource_name="str", - parameters={"loadBalancerNames": ["str"]}, - api_version="2025-10-02-preview", - ) - ).result() # call '.result()' to poll until service return final result + async def test_managed_clusters_list_mesh_upgrade_profiles(self, resource_group): + response = self.client.managed_clusters.list_mesh_upgrade_profiles( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_clusters_list_kubernetes_versions(self, resource_group): + response = await self.client.managed_clusters.list_kubernetes_versions( + location="str", + ) # please add some check logic here by yourself # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_namespaces_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_namespaces_operations.py index f1c0fff5297a..0cd7b2e197d2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_namespaces_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_namespaces_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestContainerServiceManagedNamespacesOperations(AzureMgmtRecordedTestCase) def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_namespaces_list_by_managed_cluster(self, resource_group): - response = self.client.managed_namespaces.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_namespaces_get(self, resource_group): @@ -37,7 +25,6 @@ def test_managed_namespaces_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", managed_namespace_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -81,12 +68,24 @@ def test_managed_namespaces_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_namespaces_update(self, resource_group): + response = self.client.managed_namespaces.update( + resource_group_name=resource_group.name, + resource_name="str", + managed_namespace_name="str", + parameters={"tags": {"str": "str"}}, + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_namespaces_begin_delete(self, resource_group): @@ -94,7 +93,6 @@ def test_managed_namespaces_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", managed_namespace_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -102,15 +100,12 @@ def test_managed_namespaces_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_namespaces_update(self, resource_group): - response = self.client.managed_namespaces.update( + def test_managed_namespaces_list_by_managed_cluster(self, resource_group): + response = self.client.managed_namespaces.list_by_managed_cluster( resource_group_name=resource_group.name, resource_name="str", - managed_namespace_name="str", - parameters={"tags": {"str": "str"}}, - api_version="2025-10-02-preview", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -121,7 +116,6 @@ def test_managed_namespaces_list_credential(self, resource_group): resource_group_name=resource_group.name, resource_name="str", managed_namespace_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_namespaces_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_namespaces_operations_async.py index a4ac9f958f32..f71dc16a9e65 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_namespaces_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_managed_namespaces_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestContainerServiceManagedNamespacesOperationsAsync(AzureMgmtRecordedTest def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_namespaces_list_by_managed_cluster(self, resource_group): - response = self.client.managed_namespaces.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_namespaces_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_managed_namespaces_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", managed_namespace_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -83,13 +70,25 @@ async def test_managed_namespaces_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_namespaces_update(self, resource_group): + response = await self.client.managed_namespaces.update( + resource_group_name=resource_group.name, + resource_name="str", + managed_namespace_name="str", + parameters={"tags": {"str": "str"}}, + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_namespaces_begin_delete(self, resource_group): @@ -98,7 +97,6 @@ async def test_managed_namespaces_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", managed_namespace_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -107,15 +105,12 @@ async def test_managed_namespaces_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_namespaces_update(self, resource_group): - response = await self.client.managed_namespaces.update( + async def test_managed_namespaces_list_by_managed_cluster(self, resource_group): + response = self.client.managed_namespaces.list_by_managed_cluster( resource_group_name=resource_group.name, resource_name="str", - managed_namespace_name="str", - parameters={"tags": {"str": "str"}}, - api_version="2025-10-02-preview", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -126,7 +121,6 @@ async def test_managed_namespaces_list_credential(self, resource_group): resource_group_name=resource_group.name, resource_name="str", managed_namespace_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_mesh_memberships_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_mesh_memberships_operations.py index 50959e68bb7c..d67d94dbe23a 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_mesh_memberships_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_mesh_memberships_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestContainerServiceMeshMembershipsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_mesh_memberships_list_by_managed_cluster(self, resource_group): - response = self.client.mesh_memberships.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_mesh_memberships_get(self, resource_group): @@ -37,7 +25,6 @@ def test_mesh_memberships_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", mesh_membership_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -66,7 +53,6 @@ def test_mesh_memberships_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -79,8 +65,18 @@ def test_mesh_memberships_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", mesh_membership_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_mesh_memberships_list_by_managed_cluster(self, resource_group): + response = self.client.mesh_memberships.list_by_managed_cluster( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_mesh_memberships_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_mesh_memberships_operations_async.py index 52f0de076c58..7cd2b4992791 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_mesh_memberships_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_mesh_memberships_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestContainerServiceMeshMembershipsOperationsAsync(AzureMgmtRecordedTestCa def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_mesh_memberships_list_by_managed_cluster(self, resource_group): - response = self.client.mesh_memberships.list_by_managed_cluster( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_mesh_memberships_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_mesh_memberships_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", mesh_membership_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -68,7 +55,6 @@ async def test_mesh_memberships_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -83,9 +69,19 @@ async def test_mesh_memberships_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", mesh_membership_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_mesh_memberships_list_by_managed_cluster(self, resource_group): + response = self.client.mesh_memberships.list_by_managed_cluster( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_open_shift_managed_clusters_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_open_shift_managed_clusters_operations.py deleted file mode 100644 index 5d0b5a4aa0d3..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_open_shift_managed_clusters_operations.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerservice import ContainerServiceClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerServiceOpenShiftManagedClustersOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerServiceClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list(self, resource_group): - response = self.client.open_shift_managed_clusters.list( - api_version="2019-09-30-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): - response = self.client.open_shift_managed_clusters.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2019-09-30-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get(self, resource_group): - response = self.client.open_shift_managed_clusters.get( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2019-09-30-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): - response = self.client.open_shift_managed_clusters.begin_create_or_update( - resource_group_name=resource_group.name, - resource_name="str", - parameters={ - "location": "str", - "agentPoolProfiles": [ - { - "count": 0, - "name": "str", - "vmSize": "str", - "osType": "Linux", - "role": "str", - "subnetCidr": "10.0.0.0/24", - } - ], - "authProfile": { - "identityProviders": [ - {"name": "str", "provider": "open_shift_managed_cluster_base_identity_provider"} - ] - }, - "clusterVersion": "str", - "fqdn": "str", - "id": "str", - "masterPoolProfile": { - "count": 0, - "vmSize": "str", - "name": "str", - "osType": "Linux", - "subnetCidr": "str", - }, - "monitorProfile": {"enabled": bool, "workspaceResourceID": "str"}, - "name": "str", - "networkProfile": {"peerVnetId": "str", "vnetCidr": "10.0.0.0/8", "vnetId": "str"}, - "openShiftVersion": "str", - "plan": {"name": "str", "product": "str", "promotionCode": "str", "publisher": "str"}, - "provisioningState": "str", - "publicHostname": "str", - "routerProfiles": [{"fqdn": "str", "name": "str", "publicSubdomain": "str"}], - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2019-09-30-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_update_tags(self, resource_group): - response = self.client.open_shift_managed_clusters.begin_update_tags( - resource_group_name=resource_group.name, - resource_name="str", - parameters={"tags": {"str": "str"}}, - api_version="2019-09-30-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete(self, resource_group): - response = self.client.open_shift_managed_clusters.begin_delete( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2019-09-30-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_open_shift_managed_clusters_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_open_shift_managed_clusters_operations_async.py deleted file mode 100644 index 7d64a63f65cc..000000000000 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_open_shift_managed_clusters_operations_async.py +++ /dev/null @@ -1,134 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.containerservice.aio import ContainerServiceClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestContainerServiceOpenShiftManagedClustersOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list(self, resource_group): - response = self.client.open_shift_managed_clusters.list( - api_version="2019-09-30-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): - response = self.client.open_shift_managed_clusters.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2019-09-30-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get(self, resource_group): - response = await self.client.open_shift_managed_clusters.get( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2019-09-30-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): - response = await ( - await self.client.open_shift_managed_clusters.begin_create_or_update( - resource_group_name=resource_group.name, - resource_name="str", - parameters={ - "location": "str", - "agentPoolProfiles": [ - { - "count": 0, - "name": "str", - "vmSize": "str", - "osType": "Linux", - "role": "str", - "subnetCidr": "10.0.0.0/24", - } - ], - "authProfile": { - "identityProviders": [ - {"name": "str", "provider": "open_shift_managed_cluster_base_identity_provider"} - ] - }, - "clusterVersion": "str", - "fqdn": "str", - "id": "str", - "masterPoolProfile": { - "count": 0, - "vmSize": "str", - "name": "str", - "osType": "Linux", - "subnetCidr": "str", - }, - "monitorProfile": {"enabled": bool, "workspaceResourceID": "str"}, - "name": "str", - "networkProfile": {"peerVnetId": "str", "vnetCidr": "10.0.0.0/8", "vnetId": "str"}, - "openShiftVersion": "str", - "plan": {"name": "str", "product": "str", "promotionCode": "str", "publisher": "str"}, - "provisioningState": "str", - "publicHostname": "str", - "routerProfiles": [{"fqdn": "str", "name": "str", "publicSubdomain": "str"}], - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2019-09-30-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_update_tags(self, resource_group): - response = await ( - await self.client.open_shift_managed_clusters.begin_update_tags( - resource_group_name=resource_group.name, - resource_name="str", - parameters={"tags": {"str": "str"}}, - api_version="2019-09-30-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): - response = await ( - await self.client.open_shift_managed_clusters.begin_delete( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2019-09-30-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operation_status_result_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operation_status_result_operations.py index a1ab7d92ba0c..638e238e522f 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operation_status_result_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operation_status_result_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -20,38 +20,35 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_operation_status_result_list(self, resource_group): - response = self.client.operation_status_result.list( + def test_operation_status_result_get_by_agent_pool(self, resource_group): + response = self.client.operation_status_result.get_by_agent_pool( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", + agent_pool_name="str", + operation_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_operation_status_result_get(self, resource_group): - response = self.client.operation_status_result.get( + def test_operation_status_result_list(self, resource_group): + response = self.client.operation_status_result.list( resource_group_name=resource_group.name, resource_name="str", - operation_id="str", - api_version="2025-10-02-preview", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_operation_status_result_get_by_agent_pool(self, resource_group): - response = self.client.operation_status_result.get_by_agent_pool( + def test_operation_status_result_get(self, resource_group): + response = self.client.operation_status_result.get( resource_group_name=resource_group.name, resource_name="str", - agent_pool_name="str", operation_id="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operation_status_result_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operation_status_result_operations_async.py index 5723c9f333f8..1ca784249fbe 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operation_status_result_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operation_status_result_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,38 +21,35 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_operation_status_result_list(self, resource_group): - response = self.client.operation_status_result.list( + async def test_operation_status_result_get_by_agent_pool(self, resource_group): + response = await self.client.operation_status_result.get_by_agent_pool( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", + agent_pool_name="str", + operation_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_operation_status_result_get(self, resource_group): - response = await self.client.operation_status_result.get( + async def test_operation_status_result_list(self, resource_group): + response = self.client.operation_status_result.list( resource_group_name=resource_group.name, resource_name="str", - operation_id="str", - api_version="2025-10-02-preview", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_operation_status_result_get_by_agent_pool(self, resource_group): - response = await self.client.operation_status_result.get_by_agent_pool( + async def test_operation_status_result_get(self, resource_group): + response = await self.client.operation_status_result.get( resource_group_name=resource_group.name, resource_name="str", - agent_pool_name="str", operation_id="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations.py index 2472687dec4d..bf248c394ef4 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -21,9 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_operations_list(self, resource_group): - response = self.client.operations.list( - api_version="2025-10-02-preview", - ) + response = self.client.operations.list() result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations_async.py index a47052abae16..504fa307d860 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -22,9 +22,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_operations_list(self, resource_group): - response = self.client.operations.list( - api_version="2025-10-02-preview", - ) + response = self.client.operations.list() result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations.py index d10a1a2e6b82..18b5ac6756f8 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestContainerServicePrivateEndpointConnectionsOperations(AzureMgmtRecorded def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_private_endpoint_connections_list(self, resource_group): - response = self.client.private_endpoint_connections.list( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_private_endpoint_connections_get(self, resource_group): @@ -37,7 +25,6 @@ def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", private_endpoint_connection_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -53,12 +40,21 @@ def test_private_endpoint_connections_update(self, resource_group): parameters={ "id": "str", "name": "str", - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": {"description": "str", "status": "str"}, - "provisioningState": "str", + "properties": { + "privateLinkServiceConnectionState": {"description": "str", "status": "str"}, + "privateEndpoint": {"id": "str"}, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -71,8 +67,18 @@ def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", private_endpoint_connection_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_private_endpoint_connections_list(self, resource_group): + response = self.client.private_endpoint_connections.list( + resource_group_name=resource_group.name, + resource_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations_async.py index 69cfb6aac4db..7e3eff921f2d 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_endpoint_connections_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestContainerServicePrivateEndpointConnectionsOperationsAsync(AzureMgmtRec def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_private_endpoint_connections_list(self, resource_group): - response = await self.client.private_endpoint_connections.list( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_private_endpoint_connections_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", private_endpoint_connection_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -54,12 +41,21 @@ async def test_private_endpoint_connections_update(self, resource_group): parameters={ "id": "str", "name": "str", - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": {"description": "str", "status": "str"}, - "provisioningState": "str", + "properties": { + "privateLinkServiceConnectionState": {"description": "str", "status": "str"}, + "privateEndpoint": {"id": "str"}, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -73,9 +69,19 @@ async def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", private_endpoint_connection_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_private_endpoint_connections_list(self, resource_group): + response = await self.client.private_endpoint_connections.list( + resource_group_name=resource_group.name, + resource_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations.py index caba9e6f2345..3ef331a27934 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -24,7 +24,6 @@ def test_private_link_resources_list(self, resource_group): response = self.client.private_link_resources.list( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations_async.py index d62d68ff84b1..33c23260b711 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_private_link_resources_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -25,7 +25,6 @@ async def test_private_link_resources_list(self, resource_group): response = await self.client.private_link_resources.list( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations.py index 44925a10612e..89d5ac5460ea 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -32,7 +32,6 @@ def test_resolve_private_link_service_id_post(self, resource_group): "requiredMembers": ["str"], "type": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations_async.py index cef4f4c0f767..0d8c5ac67002 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_resolve_private_link_service_id_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -33,7 +33,6 @@ async def test_resolve_private_link_service_id_post(self, resource_group): "requiredMembers": ["str"], "type": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations.py index 49ce6a2ccb8b..59c26c85e9bf 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,34 +18,12 @@ class TestContainerServiceSnapshotsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_snapshots_list(self, resource_group): - response = self.client.snapshots.list( - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_snapshots_list_by_resource_group(self, resource_group): - response = self.client.snapshots.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_snapshots_get(self, resource_group): response = self.client.snapshots.get( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -59,15 +37,18 @@ def test_snapshots_create_or_update(self, resource_group): resource_name="str", parameters={ "location": "str", - "creationData": {"sourceResourceId": "str"}, - "enableFIPS": bool, "id": "str", - "kubernetesVersion": "str", "name": "str", - "nodeImageVersion": "str", - "osSku": "str", - "osType": "Linux", - "snapshotType": "NodePool", + "properties": { + "creationData": {"sourceResourceId": "str"}, + "enableFIPS": bool, + "kubernetesVersion": "str", + "nodeImageVersion": "str", + "osSku": "str", + "osType": "str", + "snapshotType": "str", + "vmSize": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -78,9 +59,7 @@ def test_snapshots_create_or_update(self, resource_group): }, "tags": {"str": "str"}, "type": "str", - "vmSize": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -93,7 +72,6 @@ def test_snapshots_update_tags(self, resource_group): resource_group_name=resource_group.name, resource_name="str", parameters={"tags": {"str": "str"}}, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -105,8 +83,25 @@ def test_snapshots_delete(self, resource_group): response = self.client.snapshots.delete( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_snapshots_list_by_resource_group(self, resource_group): + response = self.client.snapshots.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_snapshots_list(self, resource_group): + response = self.client.snapshots.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations_async.py index 4e651356f726..4a099b2e5207 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_snapshots_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,34 +19,12 @@ class TestContainerServiceSnapshotsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_snapshots_list(self, resource_group): - response = self.client.snapshots.list( - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_snapshots_list_by_resource_group(self, resource_group): - response = self.client.snapshots.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_snapshots_get(self, resource_group): response = await self.client.snapshots.get( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -60,15 +38,18 @@ async def test_snapshots_create_or_update(self, resource_group): resource_name="str", parameters={ "location": "str", - "creationData": {"sourceResourceId": "str"}, - "enableFIPS": bool, "id": "str", - "kubernetesVersion": "str", "name": "str", - "nodeImageVersion": "str", - "osSku": "str", - "osType": "Linux", - "snapshotType": "NodePool", + "properties": { + "creationData": {"sourceResourceId": "str"}, + "enableFIPS": bool, + "kubernetesVersion": "str", + "nodeImageVersion": "str", + "osSku": "str", + "osType": "str", + "snapshotType": "str", + "vmSize": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -79,9 +60,7 @@ async def test_snapshots_create_or_update(self, resource_group): }, "tags": {"str": "str"}, "type": "str", - "vmSize": "str", }, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -94,7 +73,6 @@ async def test_snapshots_update_tags(self, resource_group): resource_group_name=resource_group.name, resource_name="str", parameters={"tags": {"str": "str"}}, - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -106,8 +84,25 @@ async def test_snapshots_delete(self, resource_group): response = await self.client.snapshots.delete( resource_group_name=resource_group.name, resource_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_snapshots_list_by_resource_group(self, resource_group): + response = self.client.snapshots.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_snapshots_list(self, resource_group): + response = self.client.snapshots.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations.py index f057cf9648af..ce6166d68af2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -18,18 +18,6 @@ class TestContainerServiceTrustedAccessRoleBindingsOperations(AzureMgmtRecordedT def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_trusted_access_role_bindings_list(self, resource_group): - response = self.client.trusted_access_role_bindings.list( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_trusted_access_role_bindings_get(self, resource_group): @@ -37,7 +25,6 @@ def test_trusted_access_role_bindings_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", trusted_access_role_binding_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -51,11 +38,9 @@ def test_trusted_access_role_bindings_begin_create_or_update(self, resource_grou resource_name="str", trusted_access_role_binding_name="str", trusted_access_role_binding={ - "roles": ["str"], - "sourceResourceId": "str", + "properties": {"roles": ["str"], "sourceResourceId": "str", "provisioningState": "str"}, "id": "str", "name": "str", - "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -66,7 +51,6 @@ def test_trusted_access_role_bindings_begin_create_or_update(self, resource_grou }, "type": "str", }, - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -79,8 +63,18 @@ def test_trusted_access_role_bindings_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", trusted_access_role_binding_name="str", - api_version="2025-10-02-preview", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_trusted_access_role_bindings_list(self, resource_group): + response = self.client.trusted_access_role_bindings.list( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations_async.py index 0bb3156f0c21..0ba188c158ba 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_role_bindings_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -19,18 +19,6 @@ class TestContainerServiceTrustedAccessRoleBindingsOperationsAsync(AzureMgmtReco def setup_method(self, method): self.client = self.create_mgmt_client(ContainerServiceClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_trusted_access_role_bindings_list(self, resource_group): - response = self.client.trusted_access_role_bindings.list( - resource_group_name=resource_group.name, - resource_name="str", - api_version="2025-10-02-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_trusted_access_role_bindings_get(self, resource_group): @@ -38,7 +26,6 @@ async def test_trusted_access_role_bindings_get(self, resource_group): resource_group_name=resource_group.name, resource_name="str", trusted_access_role_binding_name="str", - api_version="2025-10-02-preview", ) # please add some check logic here by yourself @@ -53,11 +40,9 @@ async def test_trusted_access_role_bindings_begin_create_or_update(self, resourc resource_name="str", trusted_access_role_binding_name="str", trusted_access_role_binding={ - "roles": ["str"], - "sourceResourceId": "str", + "properties": {"roles": ["str"], "sourceResourceId": "str", "provisioningState": "str"}, "id": "str", "name": "str", - "provisioningState": "str", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -68,7 +53,6 @@ async def test_trusted_access_role_bindings_begin_create_or_update(self, resourc }, "type": "str", }, - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result @@ -83,9 +67,19 @@ async def test_trusted_access_role_bindings_begin_delete(self, resource_group): resource_group_name=resource_group.name, resource_name="str", trusted_access_role_binding_name="str", - api_version="2025-10-02-preview", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_trusted_access_role_bindings_list(self, resource_group): + response = self.client.trusted_access_role_bindings.list( + resource_group_name=resource_group.name, + resource_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations.py index 5476d85a7e86..952268b5482c 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -23,7 +23,6 @@ def setup_method(self, method): def test_trusted_access_roles_list(self, resource_group): response = self.client.trusted_access_roles.list( location="str", - api_version="2025-10-02-preview", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations_async.py b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations_async.py index 98dee3e589f0..827a36d7efe2 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations_async.py +++ b/sdk/containerservice/azure-mgmt-containerservice/generated_tests/test_container_service_trusted_access_roles_operations_async.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest @@ -24,7 +24,6 @@ def setup_method(self, method): async def test_trusted_access_roles_list(self, resource_group): response = self.client.trusted_access_roles.list( location="str", - api_version="2025-10-02-preview", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/containerservice/azure-mgmt-containerservice/tests/test_mgmt_aks.py b/sdk/containerservice/azure-mgmt-containerservice/tests/test_mgmt_aks.py index f57082f58b57..f2180aab4f8b 100644 --- a/sdk/containerservice/azure-mgmt-containerservice/tests/test_mgmt_aks.py +++ b/sdk/containerservice/azure-mgmt-containerservice/tests/test_mgmt_aks.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/containerservice/azure-mgmt-containerservice/tsp-location.yaml b/sdk/containerservice/azure-mgmt-containerservice/tsp-location.yaml new file mode 100644 index 000000000000..6249b333fa0d --- /dev/null +++ b/sdk/containerservice/azure-mgmt-containerservice/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/containerservice/resource-manager/Microsoft.ContainerService/aks +commit: 1bb32d7aaddc51af16d9e563d910ecec6921fae0 +repo: Azure/azure-rest-api-specs +additionalDirectories: